Calling a procedure

  • Thread starter Thread starter Crystal
  • Start date Start date
C

Crystal

I'm creating a maintenance database. The procedure I'm
working on will
1) loop through a table of updates and if the current date
and time = the UpdateDate and UpdateTime
2) open the database (using a stored pathname) and execute
the overnight update procedure stored there

I've got error handling on this procedure to tell me if
the update was completed successfully. Is it possible to
call a procedure that's in another database?

Any help would be greatly appreciated,
Crystal
 
Hi,
You could try something like this. There can be nothing requiring user interaction
in the procedure, a MsgBox for example.

Public Sub myTest()
Dim appAccess As Access.Application
On Error GoTo myTest_Err

Set appAccess = New Access.Application

appAccess.OpenCurrentDatabase "C:\newsgroup2.mdb"


appAccess.Run "TestCall"
appAccess.CloseCurrentDatabase
Set appAccess = Nothing

Exit Sub
myTest_Err:
If Not appAccess Is Nothing Then

Set appAccess = Nothing
End If
MsgBox Err.Description

End Sub

Substitute your path, and the name of the procedure you want to run.
 
Back
Top