Solved

Keep losing window when debugging

Posted on 2015-01-02
5
109 Views
Last Modified: 2015-01-09
Dear experts -
I constantly have an issue when I'm debugging whereby the form/window which had been on top ends up a level or more to the back.
It is a modal window so I can't move the window that now is appearing on top of it.
Is there a command I can issue in the immediate window that will alleviate the problem?
Thanks -
0
Comment
Question by:terpsichore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Nick67
ID: 40528138
It is annoying isn't it!?
But I do not know of a way to prevent it from happening.
Anytime a running object has it's code interrupted, it get's tossed from the focus.

About all you can do is minimize the number of other objects open at that time, to make finding it less annoying, and in the case of a modal window, turn off the modality while you are testing.

Others may have suggestions, but I don't know of a way.
0
 

Author Comment

by:terpsichore
ID: 40529292
how about this idea: call a procedure that cycles through all open forms and make them nonmodal/nonpopup.
Add the 'modal' attribute in each form's open event as appropriate...
That should work, shouldn't it?
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40529781
In the DoCmd.OpenForm command there are options for windows type to be used on open...
acDialog makes a form popup and modal.
So you can open it that way in production but leave them normal for testing.
0
 

Accepted Solution

by:
terpsichore earned 0 total points
ID: 40530157
Here is the solution I came up with that works great now - I simple run this from the command window and the problem is solved. There is no need to add code setting the modal type in the Open event either - the forms retain the original setting, whether or not this procedure is run.

Function fncFormNotModal()
'makes any OPEN form non-modal/non-popup (used for debugging)

Dim frm As Form
For Each frm In Application.Forms
If CurrentProject.AllForms(frm.name).IsLoaded = True Then
    frm.Form.Modal = False
End If
Next frm

End Function

Open in new window

0
 

Author Closing Comment

by:terpsichore
ID: 40539822
this solved the problem
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question