CochiseCounty
asked on
Pass data from one access form to another
I have a tab control, in the tab control, there are 2 forms that populated from 2 different query, and the 2 forms have some fields that are identical. What I need is what I entered in form1 will appear in form 2 when I change the tab. Please help. Thanks.
ASKER
So, if in form1, I have a control name form1field1, and in form1, I have a control name form2field1. Form1 is placed in page1 of tabcontrol1 and form2 is placed in page2 of the same tablcontrol1. What I need is when I click on page1, enter a value 'test' to the form1field1, then click on page2, the value 'test' appear on form2field1. What I need to do? Thanks for help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried that, it's not working
Let me explain again.
I have aform called Form1, in the Form1, I add tab control called TabCtl0, the tab control TabCtl0 has 2 pages (Page1 and Page2). In Page1, I add a subform called SubForm1, In Page2, I add a subform called SubForm2.
In SubForm1, I have a textfield called Text1, in SubForm2, I have a textfield called Text2. What I need is when I enter a value into Text1, click the tab Page2, the value entered in Text1 will be displayed in Text2.
Thanks for help
Let me explain again.
I have aform called Form1, in the Form1, I add tab control called TabCtl0, the tab control TabCtl0 has 2 pages (Page1 and Page2). In Page1, I add a subform called SubForm1, In Page2, I add a subform called SubForm2.
In SubForm1, I have a textfield called Text1, in SubForm2, I have a textfield called Text2. What I need is when I enter a value into Text1, click the tab Page2, the value entered in Text1 will be displayed in Text2.
Thanks for help
Are Text1 and Text2 bound to the same field?
If yes, then Text2 should automatically display the value of Text1. Is it doesn't, then you need to requery it.
If no, is there a a reason you cannot bind them to the same field?
If yes, then Text2 should automatically display the value of Text1. Is it doesn't, then you need to requery it.
If no, is there a a reason you cannot bind them to the same field?
ASKER
Hi thenelson,
I made it work, here is what I did
Private Sub Text1_AfterUpdate()
Me.Parent.Child7.Form.Text 2 = Me.Text1
End Sub
I made it work, here is what I did
Private Sub Text1_AfterUpdate()
Me.Parent.Child7.Form.Text
End Sub
Great!
Me.Parent.Fonm2Name.Form.R
In the after update event of the controls of form2 put:
Me.Parent.Fonm1Name.Form.R