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

Object reference

Status
Not open for further replies.

AChiado

Programmer
Mar 1, 2002
49
IT
Hi all,

I cant find out how to refer to a form in my program

I have Form (Eg FORM1) with a formset that contains 2 forms (FormA and FormB)
when I click on a button on Form1.FormA I hide FormA
and run a new form (Form2) whit 2 forms(FormC and FormD)

Well, when I release Form2 I want to show FormA

I can do it with ACTIVATE WINDOW FormA but if I try to reference it by Form1.FormA.Show
I receive error

Object Form1 not found

Same error when I try to refer a Form property by a program

It is sure possible but I cant find out how

Any suggestions??

Thank you Andrea C.P.
Italy [atom]
 
Use a public variable to hold the form reference.
PUBLIC Form1
DO FORM myForm.scx NAME Form1

 
HI

Forms contained within a form set retain their Visible property setting. If a form's Visible property is set to false (.F.), the Show method for the form set does not show the form. If you have set the visible property of the formset o forms contained in that, set that back before showing the show()

Form1.FormA.Visible = .t.
FOrm1.Forma.Show()
might not give that error.

Hope this helps :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Mgagnon, Ramani,

thank you for your reply.

Ramani:

if I refer to a form property from a program in VFP it works fine, but if I do it in my exe it give me that error.

It is becouse VFP create variables as public by default in command window I think.

If I follow mgagnon suggestions it works all ok.

My thought was there was a kind of parent object to refer it

something like _screen.MyForm1.MyProperty or _vfp.MyForm1.MyProperty

Thank you VM Andrea C.P.
Italy [atom]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top