jonnyboy101
Registered User.
- Local time
- Today, 06:00
- Joined
- Dec 4, 2013
- Messages
- 15
Hi all,
I am trying to write a more complex macro that will start another macro at a preset time, however I am getting stopped at the first hurdle - getting a macro to run another macro.
Here is the code i am using at the moment, all I want to do currently is click the first button, then get the second macro to execute. But no luck, getting error 2157 "cannot find the procedure"
both macros are part of the same form.
Hope someone can give me a hand, thanks, Jon
I am trying to write a more complex macro that will start another macro at a preset time, however I am getting stopped at the first hurdle - getting a macro to run another macro.
Here is the code i am using at the moment, all I want to do currently is click the first button, then get the second macro to execute. But no luck, getting error 2157 "cannot find the procedure"
Code:
Private Sub Command3_Click()
MsgBox "1st macro running", vbExclamation, "Note"
Application.Run "teststart1"
' Application.OnTime TimeValue("19:55:00"), "teststart1"
End Sub
Private Function teststart1()
MsgBox "tesststart1 running", vbExclamation, "Note"
CurrentDb.Execute "UPDATE timedata " _
& "SET breaks = breaks + #00:15:00# " _
& "WHERE running = -1"
End Function
both macros are part of the same form.
Hope someone can give me a hand, thanks, Jon