auto fill or enter new

lab18

New member
Local time
Today, 21:43
Joined
Feb 19, 2002
Messages
8
Ok guys this has probably been addressed many times, I seen similar question but most deal with my situation with combo boxes. Here is my problem.

I have a table for customers with Lastname, firstname, etc.
I have an order form where i want the user to enter the cutomer last name and first name and if theres no record on the table, get a msg that theres no record for that person an needs to be added, when user click ok another form pops up to enter the info, also need the msg to have a cancel button incase is just a misspelled name. The reason i dont want to ujse combo box is when the database grows I dont want the user to have to scroll to see if the customer is in the list.
I think I have to put some kind of code in the afterupdate property of the first name control (is the second control on the form after lastname control) but I have no knowledge of VB.
Thanks and sorry for the long post.
 
Lab18-

Were you thinking of the "On Not In List" event of a combo box? The technique for adding a new list item for a combo box is discussed in the Solutions.mdb database that used to be (and may still be) distributed with Access.

If you have the Autoexpand property set to Yes (the default, I think) the user can type just a few characters of the last name and Access will show names beginning with whatever the user types - seems like that would be a better protection from misspellings than a text box.

If you still want to do the text box you'll need to do a DLookup on the last and first names, and program something to open a new form, let the user enter the new name, etc. Given the relative ease of a combo box and the OnNotInList event I'd certainly go that way.

Jim
 

Users who are viewing this thread

Back
Top Bottom