Solved

Keep losing window when debugging

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

752 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