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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use to code to alter criteria of query using Lbox selection

Status
Not open for further replies.

Frank72

Technical User
Nov 13, 2001
57
IE
Hows it going

i'm desparately trying to use a listbox to update a criteria in a query.it is a 2 column listbox first column has a batch number(not visible) and the second a date that refers to that batch number, in other words a report will be run that has already been run using a date given by a text box. in running this query (text box) the date and franchise (from combo) create a batch which is given an auto number.
so i'm logging all the batches in this 2 column lbox and when the user selects a 'date up to' i want the batch number to be the value referenced and for it to be passed into the query as a criteria:
'where tblCustomerVehicle[WarrantyRebateBatchNbr] = me![lstDateUpTo]'

can i use doCmd and some code similar to the above or maybe the where condition in a macro???

any help gratefully received, if my explanation is crap please let me know!!!!

Thank You

Frank
 
It's even easier than that. Just set the field's criteria to the listbox in the query itself:

[Forms]![FormName]![ListBoxControlName]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top