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

Timer Trigger Method On Linked Form Issue 1

Status
Not open for further replies.

xBaseDude

MIS
Jan 31, 2002
357
US
Friends;

I have defined 1 form (Main) with a timer. My goal is for the timer to trigger a property on form 2 (Child) that is modeless top-level and linked to Main. If form 2 Child does not exist, set this property on form 1.

The child form does not have any database behind it, but I'm getting an err that when the timer fires, fox "Can not access selected table."

In the timer event of Main, I'm guessing code like...

IF WEXIST(oChild)
oChild.image1.value = m.mypix
ELSE
Thisform.image1.value = m.mypix
ENDIF

Seems to work when the oChild is not on top.

Any ideas?

Thanx - Wayne
Any idea why I'd be getting the error?

sig_jugler.gif
...all this and tap dancing too!
 
Wayne

Suggest you create an object reference for your child form with:-

PUBLIC oChild
DO FORM child NAME oChild

IF VARTYPE(oChild) = [O]
oChild.image1.value = m.mypix
ELSE
Thisform.image1.value = m.mypix
ENDIF

It would seem that when WEXIST(oChild) is true, the object reference oChild is not found, hence the error message which is not relevant to the error.

By making oChild a PUBLIC variable, you should resolve the issue.

WEXIST() has been largely replaced by TYPE() or VARTYPE() as a means of determining the existence of an object.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Thanx Chris! Works like a charm!

Note to lurkers, correct code is...

oChild.image1.picture = m.mypix

...we code too late at night sometimes.[g]

Take Care

sig_jugler.gif
...all this and tap dancing too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top