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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does database window open after code debug? 1

Status
Not open for further replies.

anthonygu

IS-IT--Management
Jan 10, 2002
8
0
0
GB
When I debug VBA code attached to a form and then close the VBA window the Access database window always pops up, even though I was previously working on the form. This is really just a minor thing but when you are going back and forth running code, making changes and editing the form, it starts to be become a big irritation. I do not want the database window to pop up, ever, whilst I am doing code. But I do not want to hide it either. I just want it to stay behind the other windows until I call it, not Access.

I can't find this in the FAQs - please point me to it if it is.
 
While your code is stopped at the breakpoint, Access disables the form's window so that you can't do anything to it. (Even moving the mouse over the form generates MouseMove events, and those can't be allowed to occur while the stopped event is still active.)

When the form window is disabled, any other windows (not just the Database Window) will float above it. This avoids a serious problem that could happen in the general case: Suppose the disabled window completely covered the window you needed to access in order to make the window enabled again? You can't close or more the disabled window because it's disabled, but you can't bring the covered window to the front because no part of it is uncovered. If this were allowed to happen, you'd have to kill the application with the Task Manager. To avoid this, Windows sends a disabled window to the back, underneath all other windows.

When you resume the code from the breakpoint, the original order of the windows is lost, so your form window stays at the back. You could consider it a design shortcoming, perhaps, that Access doesn't remember the window order and restore it for you. That would be troublesome, though--what if you had closed some of the windows that were open when the breakpoint happened? Or what if you had opened other windows during the breakpoint?

One thing you can do that might help is to minimize the Database Window. It will still pop in front of your form, but if it's just a title bar at the bottom it probably won't be in the way.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top