I have done some research, and I think the best way to automatically run a macro is to use the AutoExec method in Access.
I believe the script below will do the job.
Option Compare Database
'------------------------------------------------------------
' AutoExec
'
'------------------------------------------------------------
Function AutoExec()
On Error GoTo AutoExec_Err
DoCmd.RunCommand acCmdWindowHide
MsgBox "Welcome to the client billing application!", vbOKOnly, "Welcome"
DoCmd.OpenTable "Orders", acViewNormal, acEdit
AutoExec_Exit:
Exit Function
AutoExec_Err:
MsgBox Error$
Resume AutoExec_Exit
End Function
Now my question is the best way to trigger an access database opening event? Unfortunately, the Windows Task Scheduler is disabled by my IT department (he must love it).
I think there should be a way to get Outlook to open the access database as a task or something similar. I experimented with several ideas, but couldn't work anything.
Does anyone know how to do this?
To add a little more color to this, basically I want to automatically import data from a remote SQL Server database into Access. As you might have guessed, SQL Server Agent is also disabled.
, Outlook, , .