tinmanjo Posted March 18, 2010 Posted March 18, 2010 (edited) Hi I'm wondering how to hide the entire database window in Access 2007, I am writing an app for monitoring jobs and task I do at work but I want the main form to be shown only. I've discovered a ludicrous way of hiding the ribbon bar though (Microsoft say you have to create a table to create a custom ribbon in order to hide the main ribbon bar) http://msdn.microsoft.com/en-us/library/bb258192.aspx, but this still shows the main window still, I wish to hide the lot if possible, Ive tried to insert the API routine for hiding windows which worked ok in 2003 but not in this version. Does anyone know a workaround? Dave. Edited March 18, 2010 by tinmanjo
LosOjos Posted March 18, 2010 Posted March 18, 2010 Add this in to a module: Private Declare Function ShowWindowAsync Lib "user32" ( _ ByVal hwnd As Long, _ ByVal nCmdShow As Long) _ As Boolean Private Const SW_HIDE = 0 Private Const SW_SHOW = 5 then when you want to hide Access, use this line: ShowWindowAsync Application.hWndAccessApp(), SW_HIDE to show Access again it's: ShowWindowAsync Application.hWndAccessApp(), SW_SHOW I think you have to have your form set to modal for this to work but I could be wrong (it's not unusual)
Mongo Posted March 18, 2010 Posted March 18, 2010 Sorry I am a bit of a novice and I am having a little trouble following your instructions. When you say use this line of code "ShowWindowAsync Application.hWndAccessApp(), SW_HIDE" how exactly is that done?
LosOjos Posted March 18, 2010 Posted March 18, 2010 Always happy to help The code is VBA, you need to open the Visual Basic Editor and insert the code in there to run it. If you're not familiar with VBA, I'd recommend googling a few lessons on it, it really opens up Office to a a hell of a lot more functionality
zorik2 Posted May 10, 2013 Posted May 10, 2013 Hi there, I'd like to read more about these commands. I found hardly any reference to them, and none on MSDN. Thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now