The simplest way to handle the search part is to use a Combobox; the Wizard will take you through the process. If you haven't already done so, create a Form based on your Table, including all the Fields you want displayed.
Then simply:
- Add a Combobox to your Form.
- The Combobox Wizard will pop up
- Select "Find a record based on the value I selected in my combobox."
- From the Table the Form is based on, click on the Field you're searching by (a Field that is unique for each Record) to move it to the right side.
- Hit Next.
- Size the column appropriately.
- Hit Next.
- Name the Combobox something appropriate.
- Hit Finish.
Now you can drop the Combobox down and scroll down to the item to search by, or you can start to enter the item by typing and the Combobox will "autofill" as you type. Hit <Enter> and the Record will be retrieved.
Be warned, although much of Access VBA and Excel VBA is the same, their are differences! Some Functions are present in one app but not in the other, and some Functions, with identical names, do not do the same thing in both apps!
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007