Passing data from one control to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Let's say I have two forms open - frmA and frmB. After a button on frmA is clicked, how would I pass a value (string) from one textbox on frmA to another textbox on frmB? Thanks.
 
Let's say I have two forms open - frmA and frmB. After a button on frmA is clicked, how would I pass a value (string) from one textbox on frmA to another textbox on frmB? Thanks.

You can refer to it through the forms collection like...

Forms!frmB!txtToReceive = Me.txtSend


- Jim
 
Ken this should work for you. Apply this code to your
command button's OnClick Event Property.

Private Sub cmdTestBtn_Click()
[Forms]![formB]![txt1] = [Forms]![formB]![txt1]
End Sub

chris a.k.a.

TheOriginalStealth
-----Original Message-----
Let's say I have two forms open - frmA and frmB. After
a button on frmA is clicked, how would I pass a value
(string) from one textbox on frmA to another textbox on
frmB? Thanks.
 
Since the code is running in response to a button on
FormA, you need to fully reference FormB and its textbox
control. This should work...
Forms!frmYourForm.txtYourTextBox = strFormAValue
-----Original Message-----
Let's say I have two forms open - frmA and frmB. After a
button on frmA is clicked, how would I pass a value
(string) from one textbox on frmA to another textbox on
frmB? Thanks.
 
Back
Top