Do more with
Public Function UpdateCounterFields(strDBPath)
'Created by Helen Feddema 19-Jun-2009
'Last modified 19-Jun-2009
On Error GoTo ErrorHandler
Set appAccess = GetObject(, "Access.Application")
appAccess.OpenCurrentDatabase strDBPath
appAccess.Run procedure:="UpdateCounterField"
ErrorHandlerExit:
appAccess.Quit
Set appAccess = Nothing
Exit Function
ErrorHandler:
'Access is not running; open Access with CreateObject
If Err.Number = 429 Then
Set appAccess = CreateObject("Access.Application")
Resume Next
Else
MsgBox "Error No: " & Err.Number & "; Description: "
Resume ErrorHandlerExit
End If
End Function
Premium Content
You need an Expert Office subscription to comment.Start Free Trial