Access Property Value Of Control That Found On Other Form

If you want to change the Text property of "Text1" Text Box that found
on "Form2" form use the following code:

Form2.Text1.Text = "New Text"

An example:


Add another form to your project (named Form2 by default).
Put 1 Command Button on Form1 form, and 1 Text Box on Form2 Form
Add the following code to Form1 Form:

Form Code

Private Sub Command1_Click()
    MsgBox Form2.Text1.Text
End Sub

Go Back