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!

POS dbase Macro problem

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
 
It may be easier to use a command line to run the macro, rather then setting any objects.

just open the .mdb, .mde with then /x switch. You may do this in code with the shell command.

Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
And shouldn't mbd be replaced with mdb ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top