You might make a project. My example is simple but shows the notion of
what you can do
When the main for opens it sets a time you could increase the interval as
the testing does not have to happen too often if it us just running a
query around 5:30 pm. This timer will fire and do nothing until the
critacial time is hit. in my case 5:42:30 PM" which seems a fine time to
run the qurey. It then sets a flag so it will not run the query again and
then calls a sub where you could put your code to run the query. it then
continues to loop, but does nothing as long as the date and the startdate
are the same, When the date rolls over it resets the flag to run the query
and continues checking until the appropreate time.
this steels a bit of time every interval thus unless you need tight times
you might make the interval fairly large. Or perhaps have two time checks
one that is for big interval and one that is smaller for when we get close
to the time.
You could start this app in a number of ways. launch it when windows starts.
HTH
Michael McCaffrey
Option Explicit
Dim fGoRun As Boolean
Dim StartOn As Date
Private Sub DoTime_Timer()
If fGoRun = True Then
If Time() > “5:42:30 PM” Then
fGoRun = False
RunQuery
End If
End If
If StartOn < Date Then
fGoRun = True
End If
Me.Text1 = Format(Now, “YYYY/MM/DD HH:NN:SS AMPM”)
DoEvents
End Sub
Private Sub Form_Load()
fGoRun = True
Me.DoTime.Enabled = True
Me.DoTime.Interval = 1000
StartOn = Date
End Sub
Sub RunQuery()
MsgBox “I have run somethin”
End Sub
Arnold,
The flaw in your plan is that you have to be sure that the Access
application is running at whatever time you want the query to execute .
. . and how do you do that without using the scheduler? 
Respectfully,
Ralph D. Wilson II
Senior Programmer Analyst
Information Technology Department
9311 San Pedro Suite 600
San Antonio TX 78216
(800) 527-0066 x7368
(210) 321-7368 (direct)
ralphwilson@swbc.com
" arnold.mahlu… via vb-access-l"
08/03/2006 02:23 PM
Please respond to
vb-access-l@Groups.ITtoolbox.com
To
Ralph Wilson
cc
Subject
RE: [vb-access-l] How To Create A Timer In VBA To Run A Query
Thanks Lynn, I’ve already set that up but I’m looking for an exclusively
internal function or subroutine that will also do that without having to
rely on “task scheduler.” I believe it can be done using the “on timer”
property in a form field but don’t have specifics.
Arne
“lpfannenstiel via vb-access-l”
08/03/06 10:41 AM >>>
I have a task, db update, which needs to run every nite. I set up an
Access database having an autoexec macro that runs my desired task.
Within Windows XP, I have a scheduled task that runs at 2am every
morning, opening the Access db, running the autoexec macro, which
fires
the desired activity, qry, whatever.
Hope that helps.
Lynn