Creating a new entry in a subform

  • Thread starter Thread starter Dan Cole
  • Start date Start date
D

Dan Cole

I have a form called Orders and a subform called
Customers. CustID in the Orders table is linked to CustID
in the Customers table. When I enter a customer ID in the
CustID field in Orders, it brings up that customer's
information in the subform. If I try to enter a customer
ID that's not in the Customers table (i.e. try to create a
new customer), it says "You cannot add or change a record
because a related record is required in table 'Customer'."
How do I get it so that when I enter a new CustID on the
Orders form, it automatically creates a new entry in the
Customer table? Thanks.
 
i think you're trying to put the cart before the horse. you might try adding
perhaps a button to your main form, as "New Customer". when clicked, it
could take you to the Customer subform (or perhaps a pop-up form) to add the
new customer info, including customer number. then you can enter the
customer number in the Orders form.

hth
 
Back
Top