J
J. Trucking
Hello,
I am having an issue with a query I have built. I have a query which
searches through a table and returns a couple of fields, one of which
is called DateOfWork. The query is run when a form is filled in by
the user. The user has the option to specify a date range on the form
(text boxes) or leave the dates blank. What I would like to have is,
if the dates are blank, the query returns all values. If the dates
are specified, then the query only returns values between the dates.
I have done this before, but only for one textbox/combobox. I did it
by filling the following info into the query criteria:
[Forms]![FormName]![ComboBoxName] or [Forms]![FormName]![ComboBoxName]
is null
This worked but I am unsure how to do it for two date values. I have
done the following so far:
Between [Forms]![FormName]![StartDate] and [Forms]![FormName]!
[EndDate]
It works well but I am now unsure how to incorperate the null part.
The other thing I should mention is that the date text boxes on the
form are linked to a check box on the same form (DateCheck). So if
DateCheck is unchecked, the two date text boxes are not enabled
(greyed out). If DateCheck is checked, the boxes are enabled and the
user can specify the date range that they want. Not sure if this would
assist me in the query building. Thanks in advance for any help/
advice.
John
I am having an issue with a query I have built. I have a query which
searches through a table and returns a couple of fields, one of which
is called DateOfWork. The query is run when a form is filled in by
the user. The user has the option to specify a date range on the form
(text boxes) or leave the dates blank. What I would like to have is,
if the dates are blank, the query returns all values. If the dates
are specified, then the query only returns values between the dates.
I have done this before, but only for one textbox/combobox. I did it
by filling the following info into the query criteria:
[Forms]![FormName]![ComboBoxName] or [Forms]![FormName]![ComboBoxName]
is null
This worked but I am unsure how to do it for two date values. I have
done the following so far:
Between [Forms]![FormName]![StartDate] and [Forms]![FormName]!
[EndDate]
It works well but I am now unsure how to incorperate the null part.
The other thing I should mention is that the date text boxes on the
form are linked to a check box on the same form (DateCheck). So if
DateCheck is unchecked, the two date text boxes are not enabled
(greyed out). If DateCheck is checked, the boxes are enabled and the
user can specify the date range that they want. Not sure if this would
assist me in the query building. Thanks in advance for any help/
advice.
John