Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox to Filter Form

Status
Not open for further replies.

BJNK

IS-IT--Management
Dec 12, 2006
52
0
0
CA
Ok I apologize since I know the answer is fairly simple, but all the things I've found searching have been for more complex situations. It's always the easiest parts I struggle with the most...

I have a form based on a query of Accounts Receivable. In this form I have added a listbox showing all of our customers. I would like to have it filter the form to show only the customer that is double clicked. I originally had it set in the query for the
Customer_ID = [Forms]![InvActForm]![custlist] But that would open the form with no data until a customer was selected. I would like the form to open with all of them and then based on what is double clicked to filter to that customer.

Suggestions? Oh and yes, I want to use a listbox not a combobox if that is possible.

Thank you!
 
in the double click event of the combobox, reset the filter property of the form, or re-run the query with the selected value...

just remember to clear the filter at some point otherwise you might end up with no records next time you open the form...

--------------------
Procrastinate Now!
 
Thats exactly what I don't know how to do. Im not sure what the VB coding should be other than the DoCmd.Filter.. No idea about the rest of it.
 
A starting point:
Me.Filter = "Customer_ID=" & Me![custlist]
Me.FilterOn = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Ahh PHV my hero once again. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top