Solved

Keep losing window when debugging

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
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…

777 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