FancyPrairie
Programmer
I have some vba code that resides in my library database "MyLib.accda" (to which I have referenced). When the user clicks a button located on a form in my current database "MyCustom.accdb", a form that exists in my library is opened and the activeform (frmMain) is hidden. The library form has a button that , when pressed, executes this code:
The problem is that acCmdNewObjectDesignQuery launhes the query builder. The query builder lists all of the tables and queries that exist in my library database rather than my current database.
If I don't hide frmMain but, rather, setfocus to it prior to issuing the Application.Docmd.Run..., then the query build lists all of the tables and queries that exist in my current db. Which is what I want.
My question is: Since I can't setfocus to frmMain because it's hidden, what's the correct syntax for the line of code, shown above, so it only displays objects in my current db? Or can I set focus to the current database rather than a specific object? If so, how?
Code:
Application.DoCmd.RunCommand acCmdNewObjectDesignQuery
The problem is that acCmdNewObjectDesignQuery launhes the query builder. The query builder lists all of the tables and queries that exist in my library database rather than my current database.
If I don't hide frmMain but, rather, setfocus to it prior to issuing the Application.Docmd.Run..., then the query build lists all of the tables and queries that exist in my current db. Which is what I want.
My question is: Since I can't setfocus to frmMain because it's hidden, what's the correct syntax for the line of code, shown above, so it only displays objects in my current db? Or can I set focus to the current database rather than a specific object? If so, how?