realbasic-nug
[Top] [All Lists]

Re: Why am I getting 2 copies when I do an f.show

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Why am I getting 2 copies when I do an f.show
From: Kevin Windham <kevo at gatorgraphics dot com>
Date: Mon, 29 Nov 2004 16:35:47 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <200411292222 dot iATMMggu020434 at mac dot com>
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>

<Prev in Thread] Current Thread [Next in Thread>