55 messaggi dal 06 settembre 2002
posto il codice che ho scritto per gestire all'interno di una tabella access un menù a tendina che si popola di dati che prelevo da un'altra tabella dello stesso database;
come faccio a prendere il codice della voce selezionata dal menù e memorizzarlo sui 20 campi che appartengono alla tabella principale (campi denominati come "metodo1" "metodo2" ecc.) ?

grazie 1000



<%@ Language=VBScript %>
<html>

<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
<title></title>
</head>
<%
dim conn
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& SERVER.MapPath("../db/medici.mdb")
%>
<%
dim rs
set rs = server.CreateObject("ADODB.recordset")
id2=Request.QueryString("mediciid")
session("id2")=id2%>
<%rs.Open " select * from medicipawd where mediciid="& id2 & "",conn,1,2
nomev=rs.fields("medicinome")
curri=rs.fields("medicicurricu")&vbcrlf
note=rs.fields("medicivarie")&vbcrlf
%>

<body bgcolor="#c0c0c0" text="#008080">

<form action="modmedic3.asp" id="FORM1" method="post"
onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<table width="100%" border="0">
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Nome/ Cognome</strong></font></td>
<td width="41%"><input id="text8" name="nomev" size="50" style="COLOR: rgb(128,128,0)"
value="<%=nomev%>"> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Laureato A</strong></font>
&nbsp;</td>
<td width="41%"><input id="text8" name="laure" size="50" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicilaurea")%>"> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Iscritto all'Ordine</strong></font>
<font color="#800000" face="Times New Roman"><strong>dei Medicidi </strong></font>&nbsp;&nbsp;&nbsp;
</td>
<td colspan="3"><input id="text8" name="ordine" size="30" style="COLOR: rgb(128,128,0)"
value="<%=rs("mediciiscri")%>"> <font color="#800000" face="Times New Roman"><strong>con
il n.</strong></font> <input id="text8" name="numero" size="20"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicinume")%>"> </td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Specializzazioni</strong></font></td>
<td width="41%"><input id="text8" name="special1" size="70" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicispecial1")%>"> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td width="35%"></td>
<td width="41%"><input id="text8" name="special2" size="70" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicispecial2")%>"> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td width="35%"></td>
<td width="41%"><input id="text8" name="special3" size="70" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicispecial3")%>"> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Curriculum </strong></font></td>
<td width="41%"><textarea rows="5" name="curri" cols="60"><%=curri%></textarea> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr valign="top">
<td colspan="4"><font color="#800000" face="Times New Roman"><strong>Studio professionale:</strong></font></td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>telefono</strong></font></td>
<td colspan="3"><input id="text8" name="telefono" size="30" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicitel")%>"> </td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>e-mail</strong></font></td>
<td colspan="3"><input id="text8" name="email" size="30" style="COLOR: rgb(128,128,0)"
value="<%=rs("mediciemail")%>"> </td>
</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>indirizzo&nbsp;</strong></font></td>
<td colspan="3"><input id="text8" name="indirizzo" size="50" style="COLOR: rgb(128,128,0)"
value="<%=rs("mediciindiri")%>"> </td>
</tr>
<tr>
<td colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td><font color="#800000" face="Times New Roman"><strong>C.A.P.</strong></font><input
id="text8" name="cap" size="10" style="COLOR: rgb(128,128,0)" value="<%=rs("medicicap")%>">
<font color="#800000" face="Times New Roman"><strong>Comune</strong></font> <input
id="text8" name="comune" size="40" style="COLOR: rgb(128,128,0)"
value="<%=rs("medicicomune")%>"> <font color="#800000" face="Times New Roman"><strong>Prov</strong></font>
<input id="text8" name="provin" size="4" style="COLOR: rgb(128,128,0)"
value="<%=rs("mediciprovin")%>"> <p><font color="#800000" face="Times New Roman"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Regione</strong></font> <input id="text8" name="regione" size="30"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicireg")%>"> </p>
<p>&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="35%"><font color="#800000" face="Times New Roman"><strong>Metodiche /
Apparecchiature</strong></font></td>
<td width="100%"><a href="metodi.htm">Gestione Metodiche/Apparecchiature</a><br>
<input type="text" name="metodo1" size="1"> <%lista(1)%><br>
<input type="text" name="metodo2" size="1"> <%lista(2)%><br>
<input type="text" name="metodo3" size="1"> <%lista(3)%><br>
<input type="text" name="metodo4" size="1"> <%lista(4)%><br>
<input type="text" name="metodo5" size="1"> <%lista(5)%><br>
<input type="text" name="metodo6" size="1"> <%lista(6)%><br>
<input type="text" name="metodo7" size="1"> <%lista(7)%><br>
<input type="text" name="metodo8" size="1"> <%lista(8)%><br>
<input type="text" name="metodo9" size="1"> <%lista(9)%><br>
<input type="text" name="metodo10" size="1"> <%lista(10)%><br>
<input type="text" name="metodo11" size="1"> <%lista(11)%><br>
<input type="text" name="metodo12" size="1"> <%lista(12)%><br>
<input type="text" name="metodo13" size="1"> <%lista(13)%><br>
<input type="text" name="metodo14" size="1"> <%lista(14)%><br>
<input type="text" name="metodo15" size="1"> <%lista(15)%><br>
<input type="text" name="metodo16" size="1"> <%lista(16)%><br>
<input type="text" name="metodo17" size="1"> <%lista(17)%><br>
<input type="text" name="metodo18" size="1"> <%lista(18)%><br>
<input type="text" name="metodo19" size="1"> <%lista(19)%><br>
<input type="text" name="metodo20" size="1"> <%lista(20)%><br>
</td>

</tr>
<tr valign="top">
<td width="35%"><font color="#800000" face="Times New Roman"><strong>&nbsp;</strong></font><p><font
color="#800000" face="Times New Roman"><strong>Ambulatorio : &nbsp;&nbsp;&nbsp; riceve su
appuntamento</strong></font></td>
<td width="41%">&nbsp;<p><font color="#800000" face="Times New Roman"><strong><!--webbot
bot="Validation" startspan S-Display-Name="app" S-Data-Type="String"
B-Allow-Letters="TRUE" B-Value-Required="TRUE" I-Minimum-Length="1" I-Maximum-Length="1" --><!--webbot
bot="Validation" endspan --><input type="text" name="app" size="1"
value="<%=rs("mediciapp")%>"
style="font-weight: bold; font-style: cursive; font-variant: small-caps; text-transform: capitalize; text-align: center; vertical-align: center"
maxlength="1"> &nbsp;&nbsp;</strong></font> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr>
<td colspan="4">&nbsp;<table width="100%" border="0">
<tr valign="top">
<td width="30%"><font color="#800000" face="Times New Roman"><strong>ORARIO</strong></font></td>
<td width="32%"><font color="#800000" face="Times New Roman"><strong>Dalle</strong></font></td>
<td width="38%"><font color="#800000" face="Times New Roman"><strong>Alle</strong></font></td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Lunedi</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="lun1" size="5"
style="color: rgb(128,128,0)" value="<%=rs("medicilun1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="lun2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicilun2")%>"> </td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Martedi</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="mar1" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicimar1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="mar2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicimar2")%>"> </td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Mercoledi</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="mer1" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicimer1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="mer2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicimer2")%>"> </td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Giovedi</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="gio1" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicigio1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="gio2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicigio2")%>"> </td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Venerdi</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="ven1" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("mediciven1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="ven2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("mediciven2")%>"> </td>
</tr>
<tr>
<td width="30%" valign="top"><font color="#800000" face="Times New Roman"><strong>Sabato</strong></font></td>
<td width="32%" valign="top"><input id="text8" name="sab1" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicisab1")%>"> </td>
<td width="38%" valign="top"><input id="text8" name="sab2" size="5"
style="COLOR: rgb(128,128,0)" value="<%=rs("medicisab2")%>"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="35%"><div align="center"></div><p><font color="#800000" face="Times New Roman"><strong>Note</strong></font></td>
<td width="41%"><textarea rows="5" name="note" cols="60"><%=note%></textarea> </td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
<tr>
<td width="35%"></td>
<td width="41%"><font face="Times New Roman"><input id="Submit1" name="Submit1"
type="submit" value="Modifica Dati / Rientra Ricerca Iniziale"> </font></td>
<td width="9%"></td>
<td width="15%"></td>
</tr>
</table>
<div align="center"></div>

<%sub lista(num)
dim rs1
set rs1 = server.CreateObject("ADODB.recordset")
altezza=1
nome="metodi"
multipla="2"
voce_selezione="Seleziona apparecchiatura/metodo"
rs1.Open " select * from metodi order by 2",conn,1,2
if rs1.EOF=false then
Response.Write("<select size='"&altezza&"' name="&nome&" onChange='(this.selectedIndex,this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,this.name)'" &multipla&">")
if voce_selezione<>"" then Response.Write("<option value='NULL'>" & voce_selezione & "</option>")
conta=0
do while not rs1.EOF
conta=conta+1
id=rs1("id")
if conta=1 then
Response.Write("<option value='"&rs1("metcod")&"' selected>" & rs1("metdes")&"</option>")
else
Response.Write("<option value='"&rs1("metcod")&"'>" & rs1("metdes")&"</option>")
end if
rs1.MoveNext()
loop
Response.Write("</select>")
else
Response.Write("NON PRESENTE")
end if
end sub%>
</form>
</body>
</html>

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.