List box running a query

JaredNJames

Registered User.
Local time
Today, 11:30
Joined
Jul 7, 2007
Messages
87
Hi, i have a simple query which you enter a car registration into, and when you click search it displays the car registration along with the customer name and invoice date in a listbox. (so three columns).

what i want is to be able to double click a record and then have a query run, and display the results on the screen based on the three items of data in the listbox i have double clicked.

any ideas

jared james
 
Do you want another form to open based on the information in the list box?

What exactly are you wanting it to open to? What field ties the data together?
 
basically, i want to double click on the desired record and it to open a form with the complete record on. (so the three pieces of data would be entered into a query or something along those lines if you understand me.).

jjames
 
Three pieces of info should not be necessary to pull the data. You SHOULD be able to use the registration number. To do so you would use:
Code:
DoCmd.OpenForm "YourFormNameHere", acViewNormal,,"[RegistrationNo]=" & Me.YourListBoxNameHere

Remember to change the form name, list box name, and Registration number field name to the correct names of your database.
 
there are multiple entries for each reg number, however i could use the invoice id which would do the same job.

many thanks
jared james
 
Yeah, the concepts are the same regardless of what you use to pull it. So, whatever works for your situation. Believe it, or not, it took me 10 years before I learned that one. It would have saved me so much work. :D
 

Users who are viewing this thread

Back
Top Bottom