On Nov 29, 2004, at 4:23 PM, Steve Smith wrote:
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?
It's not clear to me, but it may be in the way you reference winselect.
If that is the name of the window in your project, then it may be
loading a new instance of the window instead of using the f mentioned
above. You should try using self to reference the current window in any
code within a window.
HTH,
Kevin
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
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|