Solved

Keep losing window when debugging

Posted on 2015-01-02
5
102 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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 Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now