Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Need assistance calling Public variable in filtering query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bryce Alan Katz - 17 Nov 2005 06:41 GMT
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.
david epsom dot com dot au - 17 Nov 2005 07:31 GMT
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)

> Hey, all. I've been assigned a database project at work, and I'm stuck on
> something.
[quoted text clipped - 29 lines]
> simplistic aspects, but I'm stumped on the proper syntax for this
> application.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.