×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

I have 2 forms - form1/oView and fo

I have 2 forms - form1/oView and fo

I have 2 forms - form1/oView and fo

(OP)
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.

RE: I have 2 forms - form1/oView and fo

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:

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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close