Form to select begining and ending date

  • Thread starter Thread starter Judy Freed
  • Start date Start date
J

Judy Freed

Hi all

Hoping someone can guide me. I have a report that is generated from a form.
The form contains two drop down lists - from the first list the user selects
a begining date, and then an ending date from the second list. The
underlying query then selects all records between these two dates.
Everything works as it should.

We have found that even if the user selects a begining date of (for example)
10/5/03 and and ending date of 9/5/03, the report is still generated
correctly -so this really is not a big deal - but we are wondering how
difficult it would be to generate an error message in those instances
"Ending Date must be After Beginning Date" or something like that. I would
imagine that this would involve some kind of If...Then..Else type
statement. Am I on the right track?

Much thanks and to all of you - Happy Thanksgiving!

Judy Freed
Systems Development
 
Judy Freed said:
Hi all

Hoping someone can guide me. I have a report that is generated from a form.
The form contains two drop down lists - from the first list the user selects
a begining date, and then an ending date from the second list. The
underlying query then selects all records between these two dates.
Everything works as it should.

We have found that even if the user selects a begining date of (for example)
10/5/03 and and ending date of 9/5/03, the report is still generated
correctly -so this really is not a big deal - but we are wondering how
difficult it would be to generate an error message in those instances
"Ending Date must be After Beginning Date" or something like that. I would
imagine that this would involve some kind of If...Then..Else type
statement. Am I on the right track?

Much thanks and to all of you - Happy Thanksgiving!

Just put Validation Rules on the two controls that prevent erroneous entries.

Rule for [beginning date]...
<Nz([ending date],#12/31/9999#) Or Is Null

Rule for [ending date]
Nz([beginning date],#1/1/100#) Or Is Null

The Nz() allows for any entry in either control providing the other control has
not been filled out yet.
 
can you write down how you did the beginning and ending
date. I need to do that also. Would you know anything
about combo boxes. I have several on my form and I want
to make several selections. I put the fields in my table
from the combo box selections, but the data does not go
there it just keep updating the original entry.
thanks
 
Back
Top