Hey folks
Situation
I have two relevant tables: Orders and Customers.
I'm creating a big long form to enter a new order. One part of this form is entering the customer details. The customer and order are linked by AutoNumber CustomerID.
I have a subform called Edit Customer within the New Order form. The subform and master form are linked by a control in the New Order form called CustomerID and a control in the Edit Customer form called CustomerID.
In the header of Edit Customer form I have a search box that uses FindFirst to go to the first record with the name entered, and if that name is not found it does AddNew. I don't want the users to have to concern themselves with CustomerID at any point.
Problem
I want the CustomerID controls to be set by the subform's search box, but when I click inside the subform I get an error:
Of course, CustomerID is currently set to null because I haven't searched for a customer yet!
Any ideas?
Situation
I have two relevant tables: Orders and Customers.
I'm creating a big long form to enter a new order. One part of this form is entering the customer details. The customer and order are linked by AutoNumber CustomerID.
I have a subform called Edit Customer within the New Order form. The subform and master form are linked by a control in the New Order form called CustomerID and a control in the Edit Customer form called CustomerID.
In the header of Edit Customer form I have a search box that uses FindFirst to go to the first record with the name entered, and if that name is not found it does AddNew. I don't want the users to have to concern themselves with CustomerID at any point.
Problem
I want the CustomerID controls to be set by the subform's search box, but when I click inside the subform I get an error:
The Microsoft Access Database Engine cannot find a record in the table 'Customers' with key matching field(s) CustomerID
Of course, CustomerID is currently set to null because I haven't searched for a customer yet!
Any ideas?