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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have 2 forms - form1/oView and fo

Status
Not open for further replies.

asm338s

Programmer
Joined
Jul 16, 2001
Messages
135
Location
US
I have 2 forms - form1/oView and form2/oReports

I am calling oReports from oView

Statements in oView:
IF VARTYPE(oReports) = [O] && Forms exists
oReports.init(oView)
oReports.show()
ELSE
DO FORM arcrpts Name oReports
oReports.init(oView)
ENDif

Statements in the init() of oReports:
PARAMETERS oView
IF VARTYPE(oView) = [O]
thisform.objRef = oView
ENDif

objref is a new property that I created in oReports.
It runs fine the first time but when i go back to oView and call oReports again, I get an error saying oView is not found.
 
Where does the error appear? And what is the EXACT error you're getting? Is it "Variable 'OVIEW' is not found"?

Does the error come up in the oReports.init() method, or does it come up in a different method of the form? oView is a private variable that goes out of scope after the init method finishes and isn't available to any other method on that form.

The other confusing part: is oView an object reference to your form of the same name? Or is it a different object? If it is an object reference to the form, try using THISFORM instead of OVIEW:
Code:
IF VARTYPE(oReports) = [O] && Forms exists
     oReports.init(THISFORM)
     oReports.show()
ELSE
     DO FORM arcrpts Name oReports
     oReports.init(THISFORM)
ENDif
THISFORM is an object reference to oView, whereas oView may or may not be, depending on its scope and where you assign it elsewhere.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top