Remote Macro Access

BrianB75

Registered User.
Local time
Yesterday, 18:21
Joined
Aug 27, 2004
Messages
43
O.K., so I am trying to run a macro from another database on our network from a local database so I do not have to copy over the 40+ database objects to the local one. I could not find a way to accomplish this with just a macro so I started writing a module but I think I am missing something. Here is the code I am using:

Public Function Test_ext()
Call Test_ext_sub
End Function


Public Sub Test_ext_sub()

Dim dbs As DAO.Database

Set dbs = OpenDatabase("O:\data\pur\response\VOA_DAS_Daily.mdb")

DoCmd.RunMacro ("RunInvoices")

End Sub


When the code runs it errors out stating that:

"VOA Metrics Dev can't find the macro 'RunInvoices'"

I know the macro exists as I had just created it. Also, the VOA Metrics Dev database displayed in the error is the local database, not the one on the network.
Is the code not opening up the network database correctly?

Any help is greatly appreciated.

Thanks
 
Have a look at my method here.

You appear to have been attempting to use DAO which is for accessing data in a database table when you really wanted to open an instance of the Access database you want and manipulate that.
 
BrianB75 said:
O.K., so I am trying to run a macro from another database on our network from a local database so I do not have to copy over the 40+ database objects to the local one. I could not find a way to accomplish this with just a macro so I started writing a module but I think I am missing something. Here is the code I am using:

Public Function Test_ext()
Call Test_ext_sub
End Function


Public Sub Test_ext_sub()

Dim dbs As DAO.Database

Set dbs = OpenDatabase("O:\data\pur\response\VOA_DAS_Daily.mdb")

DoCmd.RunMacro ("RunInvoices")

End Sub


When the code runs it errors out stating that:

"VOA Metrics Dev can't find the macro 'RunInvoices'"

I know the macro exists as I had just created it. Also, the VOA Metrics Dev database displayed in the error is the local database, not the one on the network.
Is the code not opening up the network database correctly?

Any help is greatly appreciated.

Thanks

You have 2 database's right? So DatabaseA has the macro and databaseB has the tables you want to update/modify?

Couple of things to consider -

I would create a db with just the tables in it and store that on your Network and then create a front end to distribute with the macro's and code in it.

You can search for splitting a DB to accomplish this.

The above code you are using is trying to execute a macro called "RunInvoices" in your currentDB which isnt where it is.
 
Last edited:
Surjer said:
To run a macro from another DB you will need to use ADO

That is incorrect. To access a table or query in another database you can use ADO or DAO - you can not execute a macro with either of these methods.
 
sorry - I edited the post as to not pass on bad info.... I could have sworn I did that before. Guess not cause I just tried it and it didnt work...
 

Users who are viewing this thread

Back
Top Bottom