what i am trying to accomplish is populating the field on the form if the data exist in the database.
this is what i have at the top of my page(also have a utilitiy for the function):
SQL = "SELECT * FROM tblAbrasions where TestID = " & CDbl(request.querystring("testorderid") )
'Check to see if values exist
if CkExistence(strSQL) = 0 then
'A record does not exist currently. Start with empty display.
else
'A record exists. Get values.
'Declare all local variables
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:/Inetpub/wwwroot/database/Sample.mdb"
Set rs=conn.execute(SQL)
'response.write sql
if Not rs.EOF then
rs.movefirst
varTestRequestNo = rs("TestRequestNo")
varWhichTest = rs("WhichTest")
varColorway = rs("Description")
varSample = rs("Sample")
varSample2 = rs("Sample2")
varSample3 = rs("Sample3")
varSample4 = rs("Sample4")
varSample5 = rs("Sample5")
varSample6 = rs("Sample6")
varAbrasionhead = rs("AbrasionHeadNo")
varTestMethod = rs("TestMethod")
varNotes = rs("Notes")
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
======================
between the <body> </body>
======================
i have the exact variable above on a form. the below code is for if and only if the "whichtest" is not empty, then write the value of "whichtest" otherwise, it's an empty field, so leave it blank.
<select size="1" name="WhichTest" value= "<% if varTRNo <> "" then %><%=varTRNo%><%end if%>" tabindex="2">
"WhichTest" and TestMethod" use a dropdown box because it has multiple values. the rest of the field are just an input text box.
i got the textarea to show up. one of the dropdown box, i create the values. the other dropdown box, it populate from a table.
hope this clarify what i am trying to accomplish.
