Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting date range based on current date

Status
Not open for further replies.

madctch

MIS
Jun 12, 2007
18
0
0
US
I created a series of If statements in VBA that detects the current quarter. It is a text field with format 99/99/00 - 99/99/00 and I need to find a place to make sure it calculates every time the database is accessed. I am doing this in order to compare to another date field which is formatted in the same fashion. Ultimately I will be comparing the two and changing data in an action query based on whether they are equal or not.
 
When you say the "datbase is accessed" you mean when someone opens the front end or the database application right?

If you need the value to be caluclated once you could assign it to a global variable and call the procedure/function that runs it on start up by doing one of the following.

Write an autoexec macro that uses runcode to execute your procedure. Autoxec will fire everytime the database is opened by Access.

Alternately, you can call the procedure on a form's On Open Event and specify that form as the form to open in the database startup properties.

I hope this is what you are after.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top