I have a form that launches another form with f.show.
For some reason, I'm getting two copies of the form shown. One that
has the
correct data loaded in the open event, and one that's blank.
Is there something in this code in the open event that's causing
another
instance to be shown?
dim db as ODBCdatabase
dim rs as recordSet
dim sqlstr as string
dim lp as integer
db = new ODBCDatabase
db.DataSource = "DRIVER={SQL Server};SERVER=192.168.0.2;Database=MX"
if db.connect then
sqlstr = "Select * from CUSTOMER where lastname = '" +
me.selectval +
"'"
rs = db.SQLSelect (sqlstr)
rs.movefirst
winselect.lstnames.columnCount=5
while not rs.eof
winselect.lstnames.addRow rs.idxField(1).Value
lp = winselect.lstnames.lastindex
winselect.lstnames.cell(lp,1) = rs.idxfield(2).value
winselect.lstnames.cell(lp,2) = rs.idxfield(3).value
winselect.lstnames.cell(lp,3) = rs.idxfield(4).value
rs.movenext
wend
else
msgbox "connect Failed"
end if