Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26
  1. #16
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Sent via pm.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Your errors are because the two textboxes don't exist. If I add them to the form, the query and report run fine.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Hmm, I guess I don't understand. I have the text boxes on the bottom of the form with the control source =[reportprint]![txtStart] and txtEnd. Am I missing something?

  4. #19
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    =[Forms]![reportprint]![txtStart]

    refers to a textbox named txtStart on the form named reportprint. That textbox does not exist. You need two textboxes with those names. The user would input their desired starting/ending dates into those textboxes. The ones at the bottom don't do anything for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #20
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Gotcha, I see now. So I named the text boxes txtStart and txtEnd and removed the control source from the text boxes and now they allow input, However when I generate the report it's always blank.
    Just to verify this is what I have in the query
    Code:
    AND (((reports.timestamp)) Between Eval("[Forms]![reportprint]![txtStart]") And Eval("[Forms]![reportprint]![txtEnd]")))

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    In the sample db, none of the names matched. I changed one and the query/report returned that record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Working on a few bugs I will mark as solved as soon as everything runs smoothly, thank you so much.

  8. #23
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    You need to add the dates, along the lines of:

    =ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "' And ([condemp]='Brian' Or [condemp]='Chris' Or [condemp]='Jessica') AND timestamp Between #" & [Forms]![reportprint]![txtStart] & "# And #" & [Forms]![reportprint]![txtEnd] & "#")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #24
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Could you please expand on that,
    Code:
    AND (reports.timestamp Between Eval("[Forms]![reportprint]![txtStart]") And Eval("[Forms]![reportprint]![txtEnd]") ))
    With making ConcatRelated() respect the date parameters I don't understand the "#" variable?

  10. #25
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Nevermind, my head was stuck in the query. I added this to the ConcatRelated() and it works perfectly, thank you again!

  11. #26
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date Between Ranges for SQL Query
    By BigSloppyJoes2000 in forum Queries
    Replies: 7
    Last Post: 02-13-2014, 05:09 PM
  2. Replies: 5
    Last Post: 12-12-2013, 12:14 PM
  3. Query for gaps in date ranges
    By kagoodwin13 in forum Queries
    Replies: 6
    Last Post: 03-19-2012, 07:00 PM
  4. Query return for date ranges.
    By Desstro in forum Queries
    Replies: 2
    Last Post: 09-14-2010, 06:44 AM
  5. Select Query Using Different Date Ranges
    By Hemi426 in forum Queries
    Replies: 3
    Last Post: 07-26-2010, 01:06 PM

Tags for this Thread

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