Hi I am running a database in 2 stages, where on completion of stage 1 a scheduled task is created to run stage 2 10 mins after completion of stage 1. Is there a way of writing a macro from within VBA (appending to the macros collection i assume)? If so has anybody got any sample code?

Record a macro with a name, say “firstmac.”
Then create a button and go to the button code and enter
Private Sub CommandButton1_Click()
Call firstmac
End Sub
Now go back and get out of design mode and click the button. It
"Call"s the macro, does the task and returns.
From there you could us an input box to control which Macro you want
to run or have it controlled from a cell.