Change text on a textbox by clicking button on another form

XXD

Registered User.
Local time
Today, 13:14
Joined
Mar 11, 2008
Messages
68
I have two forms. I have some txtboxes on one form and a button on another. When i click the button i want the text on the textboxes on the other form to change. How do I write a code that changes for example:

Private Sub cmd_Click() <---- this is on one form (the button)
text.Text = "Hello" <----- this is on another form (the textbox)
End Sub

XXD
 
I have two forms. I have some txtboxes on one form and a button on another. When i click the button i want the text on the textboxes on the other form to change. How do I write a code that changes for example:

Private Sub cmd_Click() <---- this is on one form (the button)
text.Text = "Hello" <----- this is on another form (the textbox)
End Sub

XXD

change this line: text.Text = "Hello"

To this: Forms!YourFormNameHere.YourTextBoxNameHere = "Hello"

Don't name an object with reserved words (Text is a reserved word).
 

Users who are viewing this thread

Back
Top Bottom