combo box problem (1 Viewer)

imp

New member
Local time
Today, 12:05
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!
 

ElsVanMiert

Registered User.
Local time
Today, 12:05
Joined
Dec 14, 2000
Messages
152
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

Top Bottom