Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/05/2010, 12:59
hunabku
 
Fecha de Ingreso: diciembre-2003
Mensajes: 595
Antigüedad: 21 años, 3 meses
Puntos: 1
Ayuda con Combo

Que tal a todos espero alguien me pueda ayudar tengo un combo o lisbox el cual cargo de la B.D me traigo 2 valores el Cve_CIE y CIE_Des el cual el primero es la clave y el segundo la descripcion y tambien tengo pintado un box el cual quiero que si el usuario conoce la Cve_CIE solo la teclee en el box y esta se carge en el combo sin necesidad de desplegar dicho box mi ejemplo es el siguiente:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>COMBO</title>
</head>



<body>

<div align="center">
<label>
<input name="txtcve" type="text" id="txtcve" />
</label>
<%
Set conn=Server.CreateObject("ADODB.Connection")
conn.ConnectionString="Provider=SQLNCLI10;Server=l ocalhost;Database=SINAVE;Uid=sa;Pwd=sa;"
conn.open

Set cmd=Server.CreateObject("ADODB.Command")
cmd.activeconnection=conn
cmd.commandtext=" SELECT Cve_CIE, CIE_Des FROM Cat_CIE "

Set rs=Server.CreateObject("ADODB.recordset")
set rs=cmd.execute()
%>

<select name="DiagPrinIng2" style="width:700px">
<%
do while not rs.EOF
%>
<option value="<%=trim(rs("Cve_CIE"))%>"><%=trim(rs("CIE_D es"))%></option>
<%
rs.MoveNext
loop

rs.close
set rs = Nothing
conn.close
set conn = Nothing
%>

</select>
</div>
</body>
</html>