Limit results using 2 dates (hopefully easy)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to limit the number of records a form loads in 3 different situations with 2 dates.

Situations:
Pending = no start date, no end date
Active = start date, no end date
Finished = start date, end date

Can I do all of this with in the where statement of:
docmd.openform"blah_blah", , ,[Where statement]?

Thanks in advance
 
I'm trying to limit the number of records a form loads in 3 different situations with 2 dates.

Situations:
Pending = no start date, no end date
Active = start date, no end date
Finished = start date, end date

Can I do all of this with in the where statement of:
docmd.openform"blah_blah", , ,[Where statement]?

Thanks in advance

With some OR clauses:

([Status] = "Pending")
OR
([Status] = "Active" AND [Datefield] >=
[Forms]![formname]![StartDate])
OR
([Status] = "Finished" AND [Datefield] >=
[Forms]![formname]![StartDate] AND [Datefield] <=
[Forms]![formname]![EndDate])
 
Back
Top