Results 1 to 5 of 5
  1. #1
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133

    Select a date range for reports


    Attachment 27860

    I have attached this mock version of the project that I am working on, fairly straight forward and everything runs nicely.

    The database is simple, it has a form on one end for employees to submit conditions and another form for mgmt to print the reports of those conditions from 3 seperate departments.

    My question is looking at the printreports form is there a way that when clicking on one of these reports to print a dialog box can come up asking for the date range based on the timestamp of the condition?

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Easiest would be to create date parameters in the query that the report is based on. Best would be to provide unbound text box date fields on a form. The former provides no assurance that a valid date will be entered. Having said that, I'll take a look at your attachment.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    See attached example. Your report query (adminRQ) Year([timestamp]) field would probably be the place to put the dates (not done in the attached). So like

    Code:
    SELECT reports.cond, Count(reports.cond) AS CountOfcond
    FROM reports WHERE (((reports.condemp)="Salene" Or (reports.condemp)="Sierra117") AND 
    ((Year([timestamp])) Between [Forms]![reportprint].[txtBeginDate] And [Forms]![reportprint].[txtEndDate]) AND 
    ((Month([timestamp]))=Month(Now())))
    GROUP BY reports.cond;
    Conditions mock2.zip
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Thank you Micron, I was able to complete this using a guide online and replaced the old info in the query involving time stamp and it worked great, I appreciate you helping me.

    Link to guide http://allenbrowne.com/casu-08.html

  5. #5
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    You're welcome.

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

Similar Threads

  1. Reports by selecting a date range
    By keiath in forum Reports
    Replies: 10
    Last Post: 01-22-2014, 08:24 AM
  2. Reports with Date Range in Navigation Form
    By crix_17 in forum Reports
    Replies: 0
    Last Post: 08-07-2013, 05:21 AM
  3. Select Date Range
    By dr4ke in forum Queries
    Replies: 8
    Last Post: 06-25-2012, 07:04 AM
  4. SELECT only this DATE RANGE (Pic Attached)
    By taimysho0 in forum Programming
    Replies: 1
    Last Post: 05-30-2012, 01:18 PM
  5. Daily reports from date range tables?
    By sparker in forum Database Design
    Replies: 0
    Last Post: 03-29-2010, 11:07 AM

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