View Full Version : combo box problem


imp
04-29-2001, 12:07 PM
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!

ElsVanMiert
04-29-2001, 11:42 PM
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