Automation Server

R

Ray Hogan

Hi,
I wish to run modUpdate which includes an Append Query, Delete and Make
Table, but the following hangs on DoCmd.
I would appreciate any help.

Function UpdateRG()

Dim objAccess As Access.Application
Dim strDBPath As String

Const DB_path As String = "c:\plantreg\updaterg.mdb"

Set objAccess = New Access.Application
With objAccess
..OpenCurrentDatabase DB_path
..DoCmd.OpenFunction "modUpdate", acViewNormal, acAdd

End With
objAccess.Quit
Set objAccess = Nothing

Thanking you in anticipation.
Regards.
Rayh.
 
V

Van T. Dinh

Have you checked Access Help on the OpenFunction Method?

It looks to me that this OpenFunction Method only works in
ADP to open a SQL Server Database UDF.

Since your database is an MDB, I don't think OpenFunction
will work.

My guess is the Call statement with the Sub name or the
Function name, NOT the Module name which you seemed to use
by normal naming convention.

Check Access Help on the Call statement.

HTH
Van T. Dinh
MVP (Access)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top