Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass data from 1 form to another

Status
Not open for further replies.

jbphoenix

Technical User
Apr 19, 2007
3
US
I have an Enter_RMA form with a cmd btn on it. The btn opens another form. I would like to have the Customer_ID and Order_ID from the Enter_RMA form be on the just opened frm_6 form. I've been looking all over the place and can't seem to figure it out. Any help would be much appreciated. Thanks
 
Assuming that you don't close the first form look at the On Open event of your second forrm and try (not tested) Forms![frm_6]!{Customer_ID]=Forms![Enter_RMA]![Customer_ID]
 
You will need to change the form and control names as appropriate:

Code:
Private Sub cmdOpenOtherForm_Click()
     DoCmd.OpenForm "OtherForm"

     Forms!OtherForm!Customer_ID=Me.Customer_ID
     Forms!OtherForm!Enter_RMA=Me.Enter_RMA
End Sub

If you are familiar with classes you could also create public properties on your second form and pass the values to it that way.

A less elegant way would be to store the values in public variables and then have the second form read the values on its OnOpen or OnLoad events.

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top