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

Typical confused programmer

Status
Not open for further replies.
Jul 7, 1999
101
US
IF I am in WrtNewRec of form2 and I issue calls to all of the existing items on form2 (EDITS) they work beautifully<br>
(wheres spell check) However, the calls TO form1 (Also EDITS) gives program stops. Any ideas? Thanks
 
Tusconpapa,<br>
<br>
What way are you variables dimensioned in form1? If they are Private, then you can't reference them from another form. Maybe they are Private on form1 and Public on form2, that may explain your trouble. <br>
<br>
To reference a variable dimensioned on another form, it has to be instanced as Public.<br>
<br>
HTH,<br>
<br>
C
 
Not sure if I follow you correctly, but:<br>
<br>
If you are trying to access a control (say a text box called txtSample) on form1 from inside a sub/function in form2, the syntax is:<br>
<br>
msgbox form1.txtSample<br>
<br>
If you are trying to access a sub/function (say MyFunction) in form1 from inside a sub/function in form2, the syntax is:<br>
<br>
msgbox form2.MyFunction()<br>
<br>
You must declare MyFunction as Public in form1 to make it visible to form2 with:<br>
<br>
Public Function MyFunction() As String<br>
<br>
Hope this helps...
 
Thanks Calahans & RustyG Changed the Dims to public didn't<br>
work. changed the Private sub to public ..didn't work<br>
But u guys got the thought processes working, moved the subs to General Declarations of FORM2 (massive Cut and paste)changed the names to MysubX , FirstsubX ,AnysubX<br>
Saved it and it runs ! one more cup of coffee ! YES
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top