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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on how to use the DoCmd.RunCommand acCmdNewObjectDesignQuery

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I have a library database (lib.accdb) that is referenced from my current database (MyDb.accdb). I have code in my database (MyDb.accdb) that opens a form (frmLib) that resides in my library database (lib.accdb). The form (frmLib) has a button that when pressed issues the command "DoCmd.RunCommand acCmdNewObjectDesignQuery". The problem with the command is that it launches the query designer showing all of the queries and tables in my Library database. I want it to list all of the queries and tables in my current database (MyDb.accdb).

I have tried variations of the following code, with no luck. Any ideas?
Code:
    Dim appAccess as Access Application

    set appAccess = GetObject(CurrentProject.FullName)
    appAccess.DoCmd.RunCommand acCmdNewObjectDesignQuery
 
I'd try to pass MyDb as OpenArgs to frmLib

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

Part and Inventory Search

Sponsor

Back
Top