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

referrencing a control on form2 from form1

Status
Not open for further replies.

waynebrady

Programmer
Feb 20, 2003
24
US
How do I reference a control on form2 from within form1? Do I have to or should I use a formset?

e.g. I have a grid on form1 and "afterRowColChange" of the grid I want to automatically update/change the PDF file displayed (i'm using pdf.ocx) in Form2. If I issue
form2.olecontrol1.loadfile('myfile.pdf') from within the Afterrowcolchange event of grid on form1, I get an "Object FORM2 is not found." error

How should I reference this object?

Thanks,

Wayne

Wayne Brady
 
You need to use the actual name of the form, not what the default name or what the caption says. Or you can give it a name like:

DO FORM form2 NAME MyForm2

You can then reference it by:
MyForm2.Object.......



Dave S.
[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top