Retrieve the value of a textbox from a different form
Solved
ismolastar
Posted messages
29
Status
Member
-
ismolastar Posted messages 29 Status Member -
ismolastar Posted messages 29 Status Member -
Hello,
I would like to know what VBA code we can use to retrieve the value of a text field from a different form.
Let me explain: in form 1 I have textbox 1, then in another form 2 I have textbox 2. A button in form 1 allows me to access form 2. I would like to insert some VB code so that when I type a value in textbox 1 of form 1, it displays the same value in textbox 2 of form 2. Thank you in advance for your help.
I would like to know what VBA code we can use to retrieve the value of a text field from a different form.
Let me explain: in form 1 I have textbox 1, then in another form 2 I have textbox 2. A button in form 1 allows me to access form 2. I would like to insert some VB code so that when I type a value in textbox 1 of form 1, it displays the same value in textbox 2 of form 2. Thank you in advance for your help.
1 answer
-
Hello,
Simply with:Private Sub TextBox1_Change() UserForm2.TextBox2.Value = Me.TextBox1.Value End Sub
--
Best regards
Patrice-
-
-
-
-
Hello yes,
Indeed it works. Your response really helped me find the right wording
Here’s a summary of what I did:
I inserted the code into the event on click procedure for those who might also find it helpful.
DoCmd.OpenForm "button1"
Form_1.Value = Me.date1.Value
Form_1.Value = Me.date2.Value
and that's it
Thanks again Patrice33740
-