auto-populate fields (1 Viewer)

MSUKevin

Registered User.
Local time
Today, 17:00
Joined
May 16, 2001
Messages
75
I'm sure this issue has been discussed on this forum many times but I couldn't find the answerwhen I went back through the last couple of weeks in this forum, (or in help). If someone knows the answer to this I would appreciate it!

I have a table for customers. In order to keep the integrity of the data sound, I want the form to be able to auto-populate fields if the name is the same as one previously entered; i.e. You have a returning customer John Sanders, when you start to type the name S-a-n... Access automatically enters in the rest of the name. If the user determines the name that Access supplied is the correct customer they select that entry from the list and the rest of that customers information is automatically updated in the cooresponding fields of the form. If anyone knows the code for this it would be mucho appreciated.

Thanks,
Kevin
 

jimbrooking

Registered User.
Local time
Today, 12:00
Joined
Apr 28, 2001
Messages
210
I'd build a query that takes FirstName, LastName, and maybe MI and Company from the table, and adds a calculated field that results in LastName, FirstName MI.

Use the calculated name field (and company if desired) as the recordsource for a combo box. If the AutoExpand property for the combo box is set to Yes, Access will populate the box with "Hits" as more letters are typed. When the user is satisfied that the person has been identified, hit Tab to kick off the AfterUpdate event, which could requery a subform whose recordsource was a lookup query keyed to the combo box.

If this is a new name -i.e., no existing record - you'll want to use the OnNotInList event to add the name and other info about the new person to the table. The Solutions DB that comes with MS Access has an example.

HTH.
 

Users who are viewing this thread

Top Bottom