Scheduler/Timer

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

Guest

Does anybody know why this code work in Excel but not in Access?

Sub RunDaily()
Application.OnTime Now + TimeValue("11:00:00"), "Statcar"

End Sub

Sub Statcar()

DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OpenQuery "qmak_tbl_Statcar", acViewNormal
DoCmd.SetWarnings True
DoCmd.Hourglass False
MsgBox "qmak_tbl_Statcar has finished running!", vbOKOnly, Reminder

End Sub

Any help will be appreciated. Thank you.

Merrisa
 
Well... you can't expect Excel code to run in Access since
they have different Object Models. For example, the
(Access) Application Object doesn't have the
Method "OnTime".

HTH
Van T. Dinh
MVP (Access)
 
Back
Top