Optional (multiple) calendar criteria

Ziggy1

Registered User.
Local time
Today, 23:13
Joined
Feb 6, 2002
Messages
462
I am using this criteria with my calender on my form...

>=([Forms]![frmReport]![txtFrom]) And <=([Forms]![frmReport]![txtTo])

but I have 2 other date fields that I would like to query, so how do I go about making this optional?

Normally with a simple reference like:

Like([Forms]![frmReport]![txtFrom]) & "*"

with the form control's default value as * I tried working with that configuration but either it is not possible or I have the wrong syntax.

I'm open to a VB solution if anyone has one?

Note: I would only be using one of the date fields at any given time

thanks
 
Hi Ziggy, not sure if I have your question correct - are you wanting the query to return records between 2 dates on a form or if there is no value in the text boxes return all records?


Between [Forms]![frmReport]![TxtFrom] And [Forms]![frmReport]![TxtTo] Or ("OR" Between [Forms]![frmReport]![TxtFrom] And [Forms]![frmReport]![TxtTo]) Is Null

You could do this for both sets of your date fields.

Hth
Stu


 
holy ...I posted this just over 6 years agoo...lol, I guess you searched unanswered threads... I am pretty sure I figured it, but thanks anyways.
 

Users who are viewing this thread

Back
Top Bottom