Referencing to another Form

Barbados

Registered User.
Local time
Today, 18:26
Joined
May 22, 2013
Messages
27
Hi all,

I have my main form (say Form1). On this form there is a button and if the button is pressed, a Modal Dialog box pops up. Let's say the Modal Dialog box is called (Form99).
Furthermore, if the button (described above) is clicked, I want a piece of code to manipulate the Caption of Form99. How to do this. Basically, I have no clue how to reference to Form99 while I am in Form1.

Code:
Private Sub cmd_Button_Click()
[INDENT]' Code called from Form1.
' What code goes here?
[/INDENT]End Sub

Thanks,
Barbados.
 
I want a piece of code to manipulate the Caption of Form99. How to do this. Basically, I have no clue how to reference to Form99 while I am in Form1.

Must the manipulations be done in Form1 code? Or could Form99 check for an OpenArg and itself know what it should do based on who opened it?

Form1 to open, then reach in and modify Form99 is exactly what I have been coding this afternoon. That is fairly advanced VBA, opening forms via their class, enabling inter-form event communication (WithEvents).

The latter way is simpler code, however Form99 needs a complete list of which other forms might open Form99, all callers must specify their OpenArg token to indicate which who is opening Form99, else Form99 can not know which set of customizations to apply to itself.
 
Actually, I simply used the "On Open" event for Form99. Problem solved.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom