Need assistance calling Public variable in filtering query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey, all. I've been assigned a database project at work, and I'm stuck on
something.

The db tracks information related to the time it takes to stage various
shipments for a 2nd shift shipping operation. Shift hours run from 3PM to
2AM. I need to specifiy the the time and date (as in DATE format, MM/DD/YYYY
HH:MM:SS AM) in order to properly calculate elapsed time across the date
change.

This much I've got. Using two public DATE variables (ShiftStart and
ShiftEnd) and a custom function called InitDate() I can programmatically
determine the begin and end times of the current shift.

However, the users of this database are rather low on the computer literacy
scale and I need to be able to programmatically apply these filters WITHOUT
USER INTERVENTION. So the big question is this:

How do I reference ShiftStart and ShiftEnd in an Access query?

I have three queries which filter various aspects of the database to allow
data entry for the current shift ONLY (per the supervisor's design specs).
All three need to be able to automatically reference ShiftStart and ShiftEnd
as part of a BETWEEN criterion (e.g., BETWEEN ShiftStart AND ShiftEnd in the
query's Design View).

I know a just enough about Access and VB to muddle through the more
simplistic aspects, but I'm stumped on the proper syntax for this
application.
 
You need to declare a function to return the values.

One function each, or a general function with a parameter

gfnReportData("ShiftStart")

You can use a function like that anywhere in a query.

Or you can stuff the data into a database property,

Or you can simply write it to a table while in InitDate()

(david)
 
Back
Top