I just tested this on my example db by adding another button with code to open a select query.
Nothing happened
To get it to work I did the following
Code:
Private Sub Command25_Click()
SetAccessWindow (SW_SHOWMAXIMIZED) 'shows Access app window
ShowNavigationPane
DoCmd.OpenQuery "qryAccessErrorCodes"
Me.Visible = False 'need to hide the form as it's a popup
End Sub
Now you have a new problem
You need to reopen the form when you close the query
I've no idea how you could do that using code as you can't assign code to a query.
So instead I suggest you do the following.
Create another continuous or datasheet form with the query results.
When you click the button on the main form, open the new 'query form' and hide or close the main form
Then do the reverse when you close the query form
I use a similar idea to open the Access error codes form in my example
BUT I have to ask - it it really worth doing this in your case?