Creating a new entry in a subform

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.
 
T

tina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top