PDA

View Full Version : Report by date



Scooter172
02-08-2011, 01:23 PM
I want to be able to push a command button to view a report based on a date range. Ideally I want to push the command button on a form header and have a window open to select the date range from a drop down date selector to create the date range of the report. The given report currently gets its information from a query but I do not have the availability to select a date range.

jamesnotjim
02-08-2011, 02:32 PM
Can't you just add a start date parameter and an end date parameter to your query? Then you could use a command button on a form to open a report based on the query and the user would be prompted to enter the two parameters.

Or do you mean that you have some pre-defined date ranges, each with an associated report, and you want to present your users with a drop-down to select from one of these ranges to launch its associated report?

dicepackage
02-18-2011, 01:14 PM
You have to have the start and end date in a table somewhere. I did this myself and had to run a second query to use in the report.

Scooter172
02-20-2011, 11:30 AM
You have to have the start and end date in a table somewhere. I did this myself and had to run a second query to use in the report.
The operation I am in runs a 27 hour schedule day for employees. In other words we have overlapping schedules and calander days. For example purposes is I want to track Vehicle named 1 from its beginning of work at 02:20 to its ending time of 03:14 the following am. During that period that vehicle will make 48 trips and change operators 43 times. I need to be able to query who is on that vehicle at any given time. To complicate things further We often change assigned operators at last minute due to several reasons. Given that during each day we have as many as 35 vehicles changing operators 43 times in a day. this becomes very time consuming. Operator A will on any given day change vehicles 8-15 times. depending on the distance they travel and the time on board. It is very easy to query by date, but when I now have to requery every 7 minutes and update this information. Also taking into account that during any given time I have to track 2 days of useage for a certain period of time and for a vehicle with the same name in two seperate days.

OBP
02-26-2011, 12:21 PM
Under those circumstances I would say that you not only need start and finish dates, but also start and finish times on those days as well.

Scooter172
02-26-2011, 11:07 PM
Under those circumstances I would say that you not only need start and finish dates, but also start and finish times on those days as well.

I have that all already, that is easy to know, the question Is how to run a requery of that table automatically every 3 minutes on a form using unbound cells without having to push a command button, This requery should be run on clock time. and when the "tables" are updated it will update. Also there is a default Date() calculation in access but to calculate time in differance between measuring (minutes) you need to first divide the time between to dates and hours the convert to decimal to mathmatically show hrs/minutes of operation 1.5 vs 1H 30 Min.

OBP
02-27-2011, 03:26 AM
You can run the VBA code every 3 minutes using the Form's "On Timer" event. You will have to calculate the value to enter as it does not work in sceonds or minutes, but in milliseconds.