VB Coding in form (1 Viewer)

reptar

Registered User.
Local time
Today, 08:10
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?
 

RuralGuy

AWF VIP
Local time
Today, 09:10
Joined
Jul 2, 2005
Messages
13,826
You need to go through the Forms collection:
Forms!FirstFormName!mainHeading.Caption = "Recontacts"
...using the name of your FirstFormName of course.
 

reptar

Registered User.
Local time
Today, 08:10
Joined
Jul 4, 2005
Messages
32
cheers mate, thought it would be something like that :)
 

RuralGuy

AWF VIP
Local time
Today, 09:10
Joined
Jul 2, 2005
Messages
13,826
Glad I could be of assistance. Cheers back at you.
 

Users who are viewing this thread

Top Bottom