Thanks for the help but I think I need a little more.
My Forms are WorkOrder and Customer, with a subform, sbfCustomer within WorkOrder. My combo box to select the customer (cmbCust) has the following row source:
SELECT DISTINCT Customers.CustomerID, Customers.ContactLastName, Customers.ContactFirstName
FROM Customers;
The command button for Add New Customer has this code, to which I have added your suggestions (hopefully in the right place):
Private Sub CmdNewCust_Click()
On Error GoTo Err_CmdNewCust_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Customer"
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd, acDialog
CmbCust.Requery
Exit_CmdNewCust_Click:
Exit Sub
Err_CmdNewCust_Click:
MsgBox Err.Description
Resume Exit_CmdNewCust_Click
End Sub
When I click on the Add New Customer button I go to the customer form in add mode just fine. But when I close the customer form the workorder form remains blank. As soon as I click on the combo box to select the customer I just added, the WorkOrder form goes to the first record, or Work Order 1.
What am I doing wrong?