Add Records "on-the-fly"?
Posted on 2004-08-05
I am creating a form for an Invoice database table. One of the fields is CustomerID. This field is a lookup into a Customer database table. It successfully does the lookup based on the CustomerID (autoincrement), and displays the Customer name.
Currently, one may enter only customers that exist in the Customer database table.
I now need to provide the ability to enter a Customer that does not exist in the customer table, and for that customer to automatically be inserted into the Customer table.
Note also that currently, only the Customer name is displayed. If I do provide this "add-on-the-fly" ability, I will need to provide the ability for them to enter the other fields for the Customer record. Is there any easy way for these fields to popup only for this "add-on-the-fly" situation?
So what I need to happen is this:
a. If they are entering an existing customer, then they need only indicate the ID (or name, actually, since that is what they see);
b. If they are entering a new customer, then they need to enter all the customer fields, and this record will be added to the customer database.
How is this implemented? Should this be a sub-form? Any assistance would be welcome. Since I am an MS Access newbie, the more detail, the better.