0
votes

I'm trying to create a simple form that allows the user to search for a customer record, then either double click on the selected record from the search results, or click a command button to open the selected record in the customer form. I created a query linked to the "search for customer" form that searches either last name, first name, or ID and returns the results in a list box. That's as far as I got.

This is the criteria in my query:

Like "*" & [forms]![FRM_SearchMulti]![SrchText] & "*"
1

1 Answers

0
votes

So you have a list of customers in a list box, and you want to have the user select one and then open a form that displays the customer record based on the same table from which you are pulling the customer names for the list box.

Let's say you have ID, FirstName, LastName in your list box in that order. ID is your customer ID field. You have to set the column count to 3, column widths to 0;1;1, bound column to 1.

Now create a query that includes all the fields you want for your customer information form and the customer ID. In the criteria of the ID field, use the builder to build a reference to the list box value.

Use this query as a basis for a customer information form, and create that form.

Now, in the On Dbl Click event of the list box, you can make a macro to open the customer information form, and voila! you have the function you wanted, no code involved.