Microsoft Access Queries

Senkusha

Student Council President
gemgemgemgemgemgemgem
Staff member
Administrator
Isekai Society
Top Poster Of Month
Joined
20-Jun-2003
Messages
2,010
Reaction score
160
Age
51
Lumina
430,927
Gender
Female
HP
85/85
EP
79/80
So, since I don't really have anywhere to put this out there on the Net, and since I've spent hours searching for this answer without luck, but managed to trip over it by myself: If you want to base criteria of a query on a form, you need to do something like this:

Code:
IIf([Forms]![DatePickerForm]![DatePickerField]<>"",[Forms]![DatePickerForm]![DatePickerField],Date())

What this says is:
If the field DatePickerField on the Form DatePickerForm is not blank, then use the date from the field DatePickerFormField. If it is blank, then just use the current Date.

This code goes in the criteria blank for the Date field of your Query.
 
Back
Top