Limit results using 2 dates (hopefully easy)

J

Jon L.

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
 
J

John Vinson

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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top