Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2012
    Posts
    24

    Unanswered: Show date in report

    My report runs from a query that asks for a date range to pull data from

    Between [forms]![set date].[start date] And [forms]![set date].[end date]

    I'd like to have this date range show on my report. How do I make that happen?

    Thanks,
    Don..........

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Look at "DemoDateReportA2000.mdb" (attachment, zip).
    Look at Form1 (VBA), table, query, Reoprt1 (VBA).
    Open form and try.
    Attached Files Attached Files

  3. #3
    Join Date
    Jan 2012
    Posts
    24
    Thanks for the help. I'm not sure why but I'm getting a message that says this file was created with newer version than I have. I should have mentioned that I'm using Access 2000 (9.0.6926 SP-3) though I thought your file was also 2000.
    I'll try it a home later,
    Thanks again for your help,
    Don..........

  4. #4
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Sorry, it is Access 2002-2003.
    Here is Demo Access 2000.
    Attached Files Attached Files

  5. #5
    Join Date
    Jan 2012
    Posts
    24

    Show date in report

    I've tried the demo you sent me. It works but it's not exactly what I wanted to do.
    I'm attaching my db. My report almost works but I get a #Name? error. I don't understand why.
    The only dates you can plug in when prompted are 1/1/12 & 1/17/12 (start and end). However when I look for it at the bottom of my report I get that error #Name?

    What am I missing?

    Thanks again for all your help.
    Don..........
    Attached Files Attached Files

  6. #6
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    The error is:
    In the form "Set Date" the name of the field Start Date is "Text3" (not Start Date). The name of the field End Date is "Text5" (not End Date).
    Change it or in the form or in the queries (datesubquery, Mainquery) and in LMN Report too.

  7. #7
    Join Date
    Jan 2012
    Posts
    24
    I'm not sure what I'm doing wrong or missing. I changed the mainquery, datesubquery and LMM report to read
    text3/text5
    but it's still giving me the #name? error.


    Mainquery & datesubquery
    Between [forms]![set date].[text3] And [forms]![set date].[text5]

    Set Date (Form)
    text3 (for start date)
    text5 (for end date)

    (Control Source in LMM Report)
    =[Forms]![Set Date].[text3]
    =[Forms]![Set Date].[text5]


    I also thought if I'd just change the names in the text boxes of the SetDate form to "Start Date" & "End Date" it would be the same as everything else.
    Neither of these ideas worked.

    Can you tell me what I'm doing wrong?
    Thanks for your help,
    Don.............

  8. #8
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    It must be you make a mistake somewhere.

  9. #9
    Join Date
    Jan 2012
    Posts
    24
    I've looked at this until my eyes have crossed, but I still don't see what is wrong. Below is what is in my db. I didn't type this, I copied and pasted it from my db. Can you look and tell me what is wrong or what I should do?

    datesubquery
    Date Tested (column)
    Between [Forms]![set date].[start date] And [Forms]![set date].[end date]

    Mainquery
    Date Tested
    Between [Forms]![set date].[start date] And [Forms]![set date].[end date]

    LMM Report
    From
    =[Forms]![set date].[start date]
    To
    =[Forms]![set date].[end date]

    Set Date (Form)
    Name
    Text3
    Text5

    Would it make sense to just change the Text3 & Text5 in the Set Date (Form) to read Start Date & End Date? Wouldn't that be the same as changing everything else to Text3 & text5? Although I did that also and still got the error message.

    I apologize for being this dense but I don't see it.

    Thanks very much for your help and patience.
    Don.........

  10. #10
    Join Date
    Jan 2012
    Posts
    24
    I believe I've resolved my problems. I never did get the Report to show the dates but I did get the command button in the Set Date Form to show the dates.
    So what I did was added a button to my LMMKDATACOLLECTOR form that opens the Set Date form. Once in set date I input the dates and the Report opens up and shows the dates.
    If my explanation confuses you I'm sorry because I don't know how to describe it any other way.
    I do appreciate all your help and your patience.
    Thanks,
    Don..........

  11. #11
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Do you want a real easy way to show the date range on the report? Try this:

    1 - add two fields to your query as follows:

    Code:
    SDate: [forms]![set date].[start date]
    and

    Code:
    EDate: [forms]![set date].[end date]
    I assume your query already includes the criteria as a WHERE field:

    Code:
    Between [forms]![set date].[start date] And [forms]![set date].[end date]
    2 - In your report, add two textboxes in the page header section with the two field names, SDate and EDate, and set their Visible property to No.

    3 - Add a new textbox in the page header section. Set the Source property to
    Code:
    = "From #" & SDate & "# to #" & EDate & "#"
    Of course, you can modify the text. Just make sure you have the equal sign, the hash marks, and the double quotes in the right places, or it won't work properly.

    Sam

Posting Permissions

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