combo box problem

imp

New member
Local time
Today, 18:27
Joined
Apr 29, 2001
Messages
6
How do I restrict the number of results
from a query for the one record I type
in in a combo box, and not have all of the records returned? ie: if I type in name,
I just want the date_froms and date_tos that
relate to that name, not every one for every name. (I think I've tried the obvious things.)
Thanks so much!
 
You have to use the value of the combo-box and create a SQL-string that will become the recordsource of your form (afterUpdate-Event of the combo box).

Example for a single date:

sub_yourcomboBox_afterUpdate()

dim strSQL as string
strSQL= "SELECT * FROM INVOICES WHERE "_
& "INVOICE_DATE = #" & me!YourComboBox & "#"
me.recordsource = strSQL

end sub
 

Users who are viewing this thread

Back
Top Bottom