thought i could get my code to work but it is saying it is having issues calling access from my button. The command you used to start Microsoft office access contains an option that microsfot office access does not recognize. Below is the code i used to call MS Access and then the macro in the database. Does anyone know where i went wrong in my code. Any help would be great. Thanks
Private Sub Update1_Click()
On Error GoTo Err_Update1_Click
Dim db As Database
Dim htask As Variant
Dim Filename As String
Dim Directory As String
Dim Response As Integer
Dim AppPath As String
Dim ExecutionMacro As String
Set db = CurrentDb
Filename = "\Py_Aives.mdb"
ExecutionMacro = " /Update - Step1"
'the directory where the application lives
Directory = getpath(db.Name)
'finds where Access itself lives
AppPath = SysCmd(acSysCmdAccessDir) & "MSACCESS.EXE"
'MsgBox AppPath & " " & Directory & Filename
htask = Shell(AppPath & " " & Directory & Filename & ExecutionMacro, 1)
Exit_Update1_Click:
Exit Sub
Private Sub Update1_Click()
On Error GoTo Err_Update1_Click
Dim db As Database
Dim htask As Variant
Dim Filename As String
Dim Directory As String
Dim Response As Integer
Dim AppPath As String
Dim ExecutionMacro As String
Set db = CurrentDb
Filename = "\Py_Aives.mdb"
ExecutionMacro = " /Update - Step1"
'the directory where the application lives
Directory = getpath(db.Name)
'finds where Access itself lives
AppPath = SysCmd(acSysCmdAccessDir) & "MSACCESS.EXE"
'MsgBox AppPath & " " & Directory & Filename
htask = Shell(AppPath & " " & Directory & Filename & ExecutionMacro, 1)
Exit_Update1_Click:
Exit Sub