i thought i could get my code to work but it is saying it is having issues calling access from my button. Does anyone have a snipet of code that allows the user to click on a button and then it will call a macro and/or 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