By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,054 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,054 IT Pros & Developers. It's quick & easy.

Database Window Currently Showing

Expert Mod 15k+
P: 31,494
Does anyone know where I could find the visible status of the Database Window (from code)?

I have code to hide it specifically, but to hide it, one must first select it, which shows it. This causes it to flash briefly on the screen (if it was already hidden) and frankly, looks unprofessional.
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.SelectObject(ObjectType:=acForm, InDatabaseWindow:=True)
  2. Call DoCmd.RunCommand(Command:=acCmdWindowHide)
Jan 28 '09 #1
Share this Question
Share on Google+
6 Replies

Expert Mod 2.5K+
P: 2,545
Hi NeoPa. I have not found any property which reflects the current visibility status of the database window that could be toggled in real time to show or hide the window. There is no indication of any such property available within Access in any of the sources I've trawled so far (including MSDN and the MS knowledge base).

As I'm sure you know the norm in hiding the database window is to untick the Display Database Window tickbox in the Tools, Startup options of the database. Doing so sets the StartupShowDBWindow property in the Properties collection of the CurrentDB object which is available in code (see for example MSDN article

The current value can be shown in the immediate window of the VBE by typing

? CurrentDB.Properties("StartupShowDBWindow")

This property can be set True or False in VBA, but any change does not take effect until the next startup, and is no different to ticking or unticking the option in the Tools, Startup window anyway.

The only other option I know of to hide the window is to use an Autoexec macro to do so on startup - but the need for this use of autoexec was really superseded when the Display Database Window property was made available as part of the startup options from A2000 on I guess.

I know you are seeking a means of hiding the window without using the selection method that you show in your question first. Perhaps you are running a process that has led to the DB window becoming visible (for example, by reattaching tables), so you need to hide it again. So far, the method you are using is very similar to those recommended by other Access experts such as Allen Browne for this purpose.

Jan 28 '09 #2

Expert 100+
P: 1,923
Hi Adrian and Stewart,
If I recall correctly, the InDatabaseWindow argument of the select object statement can be set to False to hide the db window as shown below:

DoCmd.SelectObject acForm, "Any Form in YourDB", False

Jan 28 '09 #3

Expert 100+
P: 903
Check this link out.

Jan 28 '09 #4

Expert Mod 15k+
P: 31,494
@Stewart Ross Inverness
Hi Stewart. Thanks for this.

I am already setting the StartupShowDBWindow property manually, but I can change that if/when needed from code. I can also hide and unhide the database window from code when necessary (I use this in certain circumstances).

My intention is to run the "Hide database window" code only when it's currently showing, as when it is run in the situation where the database window is already hidden, it causes a noticeable flicker. Hence I need to check this status before running the code.

Showing the db window is never a problem, just having to show it before hiding it is a little messy.

I really appreciate your spending your time to help. And that goes for all who've posted too of course.
Jan 28 '09 #5

Expert Mod 15k+
P: 31,494
I believe that shows the named form pDog, rather than the database window. If the parameter is true it simply shows the database window but with the specified object selected.

I'm really not trying to sound ungrateful here. I do appreciate all comments :)
Jan 28 '09 #6

Expert Mod 15k+
P: 31,494
This looks like something I can build on mshmyob.

It also confirms my suspicion that this particular facility is NOT provided by Access itself (for some reason).

I will do some further digging and see if I can understand exactly how it's working and come up with some code of my own I'll be able to post :)
Jan 28 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.