Results 1 to 7 of 7
  1. #1
    Join Date
    May 2002
    Location
    wakefield, ri
    Posts
    35

    Post Unanswered: Entering Dates in an Unbound Form

    This is my first post, so pardon any mistakes.

    I am using a parameter criteria (Between [Forms]![frmAdhoc Practice]![BeginDate] And [Forms]![frmAdhoc Practice]![EndDate]) for input of a date range in an unbound form associated with a query and report. I also have three other fields in the form

    My problem is with that parameter criteria, the report does not produce results without entering dates. Date entries are required. Is there another criteria that would allow optional entry and get correct results?

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    I haven't tried this but I think

    Like (Between [Forms]![frmAdhoc Practice]![BeginDate] And [Forms]![frmAdhoc Practice]![EndDate]) ) & *

    May do it

  3. #3
    Join Date
    May 2002
    Location
    wakefield, ri
    Posts
    35

    Post Entering Dates in an Unbound Form

    I appreciate your suggestion - Like (Between [Forms]![frmAdhoc Practice]![BeginDate] And [Forms]![frmAdhoc Practice]![EndDate]) ) & *, but unfortunately I didn't get just the records within the date range specified. I get all the records in the associated query. Any other thoughts???

  4. #4
    Join Date
    Feb 2002
    Posts
    403
    I wasn't sure about that as I said. I think you will need to have a conditional statement, a bit of fiddling should acheive the result.

    For example iif([StartDate]<>"",[StartDate],"") or maybe iif([StartDate]<>"",[StartDate],"*") then call this something else.

    Then call this between [MyStartDate] and what have you.

  5. #5
    Join Date
    May 2002
    Location
    wakefield, ri
    Posts
    35

    Post Date Range Criteria

    A conditional statement sure sounds logical here. Sorry, I don't have much experience with programming language, so I need a bit more explanation here if you don't mind.

    Your example was:

    For example iif([StartDate]<>"",[StartDate],"") or maybe iif([StartDate]<>"",[StartDate],"*") then call this something else.

    I don't know what you mean by "then call this something else. And what about the EndDate?

    Your other example was:

    Then call this between [MyStartDate] and what have you.

    Do you mean to add a between statement after the iff statement(s)?

    Very much appreciate your time and effort,

    Scott

  6. #6
    Join Date
    Feb 2002
    Posts
    403
    What I was saying was to write a query, with StartDate and End Date as an optional field, using the conditional stetment similar to my previous post.

    Then use the optional field based on the query.

    This approach will work, but take a bit of time fiddling with.

    An alternative approach could be to test the field in the form for null or no value and then use an alternative report or query.
    Attached Files Attached Files

  7. #7
    Join Date
    Apr 2002
    Posts
    139
    Hi,

    I use this technique quit a lot:
    In the selection form, I give the start date a default value.
    Like the date the database was taken into production, or 01 january 2000.

    The end date gets the default value of today, using the Date() command.

    In that way you always take all records involved as the default record set.
    When a user wants a smaller selection, they simply enter their date range.

    Next time the selection forms opens, your defaults will be restored.

    hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •