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!

copy textbox values from one form to another

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a form called frmVehicles and another form called frmScreen, I want to copy the value held in a text box on frmVehicles, open the frmScreen and paste the copied value into another text box on this form.

I have tried this code:

DoCmd.GoToRecord "textBoxName"
DoCmd.RunCommand acCmdCopy
DoCmd.Close
DoCmd.OpenForm "frmScreen"
DoCmd.GoToRecord "newTextBoxName"
DoCmd.RunCommand acCmdPaste

If anyone can help I'd be grateful!!


Sunshine2597

 
If you can open the 2nd form before you close the first, then simply use:

form2!textbox.value = form1!textbox!value


alternatively, on closing form1, put the value of the textbox into a public variable, and set the 2nd textbox to that value on loading the 2nd form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top