Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Keep losing window when debugging

Posted on 2015-01-02
5
Medium Priority
?
116 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
  • 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

824 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