Bring form to front while hiding main database window

thisisanemergency

Registered User.
Local time
Today, 14:44
Joined
Oct 25, 2012
Messages
13
I am trying to achieve opening a form while hiding the main database window (by default). I've got it to work but the form (Pop Up) always opens behind any other non-related windows that are currently open, e.g. when opening the DB from a network folder, the pop-up form sits behind the network folder window and is not visible unless you minimise the network folder. I know users will not immediately think to close any open windows and the first instinct will be to click on the Access file in the task bar, and when clicking on that placeholder, the main DB window appears anyway. I have tried the following with the result described above in both cases:
  • On form open: DoCmd.RunCommand AcCmdAppMinimise (with the form set to Modal: Yes)
  • On form open: DoCmd.RunCommand AcCmdAppMinimise and Forms!FormName.SetFocus (with the form set to Modal: No)
I have also tried the advice here: this site - forums - showthread.php?t=115646 (I am unable to post links) by creating a new module and inserting the last two statements (ShowDbWindow False/True) in my form's "On open" event. I'm not sure I've used this correctly because I don't get any error messages, but I'm still getting the same behaviour described above. (Have I placed ShowDbWindow in the right place?)

So in a nutshell: I want my form to appear in front of any other open windows or be able to send any other windows to back.

Advice appreciated as always.
 
Open the form and it brings it to front. Set Focus to the form will also do it.
 
Open the form and it brings it to front. Set Focus to the form will also do it.

Thanks for the reply. I have tried Set Focus and still get the same result. The form pops up automatically when the database is opened - I have tried the AutoExec method and also by selecting it as start-up form in database options.
 
I finally figured it out! I found the following sources helpful:

This shows how to keep your form on top of all other open windows. I used method 3 in the Form Open Event: on vbforums.com - showthread.php?352702-Classic-VB-How-do-i-keep-a-form-on-top-of-others.

This shows how to completely manipulate the Access window rather than just using minimise/maximise: on access.mvps.org - access/api/api0019.htm.

This works with a DB that is stored on a local or network drive and also when it is saved in a SharePoint library. Yay!
 
I have been searching for a way to hide the Database window. i would like to make my current DB as protected as possible, and a macro or something that would hide the Database Window would help. I have Access opening to my SwitchBoard on startup and from there the intended audience can navigate to wherever they need to go. i am using a login to access my database right now.
 

Users who are viewing this thread

Back
Top Bottom