Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object not found

Status
Not open for further replies.

asm338s

Programmer
Jul 16, 2001
135
US
I am using 2 forms to search for records in a table. FormA shows the table and upon cliking a button formB pops up to search for a particular record in the table that these forms are using. I am using the following code under formB keypress method: so when user presses ESC at a particular record it closes formB and shows formA with the selected record as the active record.
IF (nkeycode = 27) OR (nkeycode = 13)
thisrecord = RECNO()
thisform.release
GOTO thisrecord
formA.refresh
endif
It gives me an error saying object formA not found.

Thanks
 
Did you create an object reference in the variable formA?

DO FORM MyForm NAME FormA

or

FormA = CreateObject("MyLib.MyForm")

or

DO FORM FormA Jon Hawkins
 
Assuming that FormB is a modal form that uses the default datasession (not private), change the code to:

IF (nkeycode = 27) OR (nkeycode = 13)
thisform.release
endif

Then in FormA's click code:

...
DO FORM FormB
Thisform.Refresh()
...

If FormB is a modal form that uses a private datasession, then change the code to:
** this is the same as above **
IF (nkeycode = 27) OR (nkeycode = 13)
thisform.release
endif

Then if the Form's UNLOAD() method:
RETURN recno()

And in FormA's click code:

...
lnRecno = recno()
DO FORM FormB TO lnRecno
GOTO lnRecno
Thisform.Refresh()
...

Rick

 
Jon: No I did not create an object reference to formA.

Rick: I got rid of the object not found error with your tips, but the record selected on formB still doesn't shows up as the active record on formA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top