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!

Newbie Newbie Form question

Status
Not open for further replies.

davidy

IS-IT--Management
Apr 19, 2002
13
NL
Hi,

I made 2 forms.
Now i want to change the text in the textbox on form1 through form2.

Now i get the error object not found.

I read the help file and found that you could also try this through the commandline.
I tryed form1.command1.Caption="TEST"

But also then i get object not found.


Please help i'm going mad.

Thanx,
 

Try using a public instance of the forms:
Code:
Public oForm1,oForm2
DO form form1 Name oForm1
DO form form2 Name oForm2

Now you should be able to reference oform1 from oForm2.





Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Davidy,

I think you are making a common mistake of confusing the name of the form object and the form's name property.

Try this:

1. Create your form in the form designer. Save it as (say) MyForm.

2. In the command window, launch the form with this command:
DO FORM MyForm

3. Still in the command window, reference the command button as follows:
MyForm.Command1.Caption = "Test"

This will work, because you are using MyForm to reference the form object, rather than Form1, which is merely the name property (and is not all that useful).

Hope this makes sense.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top