Results 1 to 3 of 3
  1. #1
    kekawaka is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    1

    Filter to a date range ala Allen Brown


    I'm using Allen Brown's Method Two script to filter a report by date range. It's not quite working, and I haven't been able to see the problem. I'm using the script verbatum, except that I have set the values for my report name and date field, as instructed.

    1. If I enter one or both dates in the form and submit, I get an input box asking for the value of my date field; if I enter a date there, the report runs but comes up empty (even though there are known records for the range AND for the one date I entered in the query)
    2. If I leave both date parameters empty on the form, it runs beautifully, and the report contains all the records, as it should.

    Any thoughts -- especially from anyone who is familiar with Allen Brown's solution -- would be most appreciated!

  2. #2
    Toyman is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    233
    Quote Originally Posted by kekawaka View Post
    I'm using Allen Brown's Method Two script to filter a report by date range. It's not quite working, and I haven't been able to see the problem. I'm using the script verbatum, except that I have set the values for my report name and date field, as instructed.

    1. If I enter one or both dates in the form and submit, I get an input box asking for the value of my date field; if I enter a date there, the report runs but comes up empty (even though there are known records for the range AND for the one date I entered in the query)
    2. If I leave both date parameters empty on the form, it runs beautifully, and the report contains all the records, as it should.
    Any thoughts -- especially from anyone who is familiar with Allen Brown's solution -- would be most appreciated!
    The instruction in the site describes a query in a report in which you open the report and a pop up input box asking for the date values. It does not take on the value of the date fields in your form. To have the query look for the value in your form, use this:

    >= Forms![YourFormName]![YourFormSDateName] < Forms![YourFormName]![YourFormEDateName] + 1

  3. #3
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by Toyman View Post
    The instruction in the site describes a query in a report in which you open the report and a pop up input box asking for the date values. It does not take on the value of the date fields in your form.
    Incorrect Toyman. It DOES (if you look at the method #2 which the OP has said they are attempting to use) use the form and does NOT describe a query using an input box. That is method #1, which the OP is NOT using.
    To have the query look for the value in your form, use this:

    >= Forms![YourFormName]![YourFormSDateName] < Forms![YourFormName]![YourFormEDateName] + 1
    Your suggestion is incorrect still as it would need the word AND between the two parts.

    kekawaka: If using the METHOD #2, then please post the actual code you are attempting to use AND post the name of your input form and the names of the text boxes.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date range Q
    By markjet in forum Queries
    Replies: 13
    Last Post: 07-18-2011, 01:00 PM
  2. Date Range filter in a Duplicate query
    By knickolyed in forum Forms
    Replies: 0
    Last Post: 06-27-2011, 04:56 AM
  3. Date range
    By eacollie in forum Queries
    Replies: 7
    Last Post: 06-05-2011, 03:38 PM
  4. Date Range Parameter help!?!?
    By dkstech in forum Access
    Replies: 1
    Last Post: 01-15-2011, 11:05 AM
  5. Date range help!!
    By bananatodd in forum Access
    Replies: 26
    Last Post: 10-18-2010, 01:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums