I am trying to create a button that will open a a form and insert the Customer ID into the newly opened form. the customer table is the datasource for the customber form and when the button is clicked, I would like to open the Odrers form and auto insert the cutomer number of the record in the Customer form.
It tried:
Private Sub Orders_Click()
On Error GoTo Err_Orders_Click
ID.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70
DoCmd.OpenForm "frm_orders"
DoCmd.GoToRecord , , acNewRec
CUST_ID.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70
Me.Refresh
Exit_Orders_Click:
Exit Sub
Err_Orders_Click:
MsgBox Err.Description
Resume Exit_Orders_Click
I am getting the "object required" error.
It tried:
Private Sub Orders_Click()
On Error GoTo Err_Orders_Click
ID.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70
DoCmd.OpenForm "frm_orders"
DoCmd.GoToRecord , , acNewRec
CUST_ID.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acPaste, , acMenuVer70
Me.Refresh
Exit_Orders_Click:
Exit Sub
Err_Orders_Click:
MsgBox Err.Description
Resume Exit_Orders_Click
I am getting the "object required" error.