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!

How to check with VBA code the hidden status of the database window ? 1

Status
Not open for further replies.

g11m

Programmer
May 31, 2007
2
BE
Hello everybody,
Is there a way in a form, using VBA code, to know if the database window is hidden or not ?
Explanation : when starting my MSA-2000 application, the database window is set to bet hidden. While still designing my application, I have a button in my menu/splash form that closes the current form and unhides the database window, with this code :
Code:
    DoCmd.Close
    On Error Resume Next
          ' sends answer to the confirmation message
          ' about showing the database window
    SendKeys "{Enter}"
    Application.RunCommand acCmdWindowUnhide
It works fine but not if the databse window is no longer hidden, the button is inoperative. Only way-out is to use the "close" [X] button on the top right corner of the form.
Thank you for your answer(s).
I hope my question is clear enough, French being my mother language ;-o


 
You may prefer to select an object that you know exists, this will make the database window visible without prompting. It will work whether or not the window is hidden.

DoCmd.SelectObject acTable, "tblTable", True
 
Thank you, Remou,
It works fine. Have a nice day.

Michel, Rixensart (BW), Belgium,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top