Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Button to search by date

Status
Not open for further replies.

randaj

MIS
Jan 7, 2003
34
US
Why doesn't this work;

IIf([Forms]![frmAdvQry]![fraDate]='2',[tblNotebook_Sub]![Date],[Forms]![frmAdvQry]![fraDate]='1' Between [Start Date] And [End Date])

I setup a form with a frame (fraDate) and two option buttons inside it (optYes and optNo). I would like for the end user to be able to decide if they want to search by date or not to. I set the default to No (indexed as 2).
 
Avoid, if you can, spaces in object names, use Start_Date or End_Date or SDate and EDate rather than "Start Date" and "End Date". I don't think you need the ' around the numbers, they are not strings.

Try:

IIf(Forms![frmAdvQry]![fraDate]=2,Forms![tblNotebook_Sub]![Date],Forms![frmAdvQry]![fraDate]=1)

I'm not sure how this works into it:

Between [Start Date] And [End Date])
 
The
Between [Start Date] And [End Date])

Is just a basic parameter that pops up.
 
Usually I have lucked putting the restrictions outside the IIF statement. Let me know if you have any luck; redefine more specifically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top