If you want both data entry and look-up, you run into a problem. People may accidentally type over a record if you don't lock it first when they're searching. It's best to have a search field on the form for looking up data. Once found, an EDIT button would allow the user to change data by making the form read/write vs. read-only.
If you want to avoid that step, you can open a form for intended data entry at a new record. Populate a last name and first name dropdowns with all persons in the database. When users type into the last name dropdown, Access will try to autocomplete the name. When found, the person tabs to the first name field whereupon that dropdown will requery to be only those first names whose last names match what the person selected. Once done, if a record matches with that name combination, you can have the record jump to the one with that combination last/first name. If no records match, you'd be at a new record anyway and would be entering a new record.
Because last name / first name combination is not ideally unique (take "John Smith," for example), it's not the best approach for your desired situation. A better method would be for you to enter a UNIQUE identifier first (instead of name) and then the record would either jump to an existing one or become a new record. However, new customers will not have a unique ID yet.
Therefore, the best idea is to have that search field on top of the form with a subform that lists the finds. You can then highlight one and click an EDIT button, or find none and click a CREATE button.
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
Last edited by SerranoG; September 8th, 2009 at 03:49 PM..
|