VB Coding in form

reptar

Registered User.
Local time
Yesterday, 21:45
Joined
Jul 4, 2005
Messages
32
I have a quick question. I have a main form with a label and a button on it. When the button is pressed a secondary form pops up. The second form has a button on it also. I am trying to code the button on the second from so that when it is pressed the label changes its value on the first form. In the past it was quite easy as there was no second form so in the Onclick VB coding of the button on the first form had something like:

With Me.mainHeading
.caption = "Recontacts"
End With

But, with the secondary form, the "Me." does not work. Is there a way i can replace the "Me." with some sort of link back to the first form?
 
You need to go through the Forms collection:
Forms!FirstFormName!mainHeading.Caption = "Recontacts"
...using the name of your FirstFormName of course.
 
cheers mate, thought it would be something like that :)
 
Glad I could be of assistance. Cheers back at you.
 

Users who are viewing this thread

Back
Top Bottom