Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running an Access Macro from a different Dbase

Status
Not open for further replies.

DavidRobertArchibald

Technical User
Apr 23, 2007
5
CA
In our POS dbase I'm currently trying to run a Macro in a second database from a for in the first, I tried the following:
Sub AccessTest1()
Dim A As Object

Set A = CreateObject("Access.Application")

A.Visible = False

A.OpenCurrentDatabase ("C:\Documents and Settings\David Archibald\My Documents\GBL Database Project\Pending.mbd")

A.DoCmd.RunMacro "GBLPost"


End Sub

But I keep getting "Run-time error '7866': Microsoft Office Access can't open the database because it is missing, or opened exclusivly by another user"
I checked to make sure that there were no other instances of MSACCESS running (other then the one I'm runnning the macro from). Does anyone know how I can do this?

arch
 
This looks like Access VBA rather than VB6. Read faq222-2244 to see how to get the best from these forums, then post this question in forum705

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top