okie,.. I'm going to try and do this in a way so you learn the idea and can do it youself from now on.
Code:
szCommissionable = ""
if not(myRec.EOF) then
szCommissionable = myRec("Commissionable ")
end if
call myRec.Open("SELECT Value, Description FROM Trim.dbo.viewZYesNo", myCon)
do while not myRec.EOF
'somewhere in here you need to decide what to select
szOptions5 = szOptions5 & "<OPTION value=""" & CStr(myRec("Description")) & """>" & _
myRec("Description") & "</OPTION>" & Chr(10)
myRec.MoveNext
loop
call myRec.Close
call WriteTableLine("Commissionable:", "<SELECT id=Commissionable name=Commissionable>" & _
"<OPTION value=""""> </OPTION>" & _
szOptions5 & "</SELECT>")
See the bold line above. In that loop you need to decide what option you want selected. Use a stand if statement and if it is the right one write out the selected attribute... in psuedo code something like....
Code:
do while not myRec.EOF
if thisoption = selectedOption then
szOptions5 = szOptions5 & "<OPTION selected value=""" & CStr(myRec("Description")) & """>" & _
myRec("Description") & "</OPTION>" & Chr(10)
else
szOptions5 = szOptions5 & "<OPTION value=""" & CStr(myRec("Description")) & """>" & _
myRec("Description") & "</OPTION>" & Chr(10)
end if
myRec.MoveNext
loop