MsgBox appears behind form and appears to lock up application.

  • Thread starter Thread starter C. L. Aitken
  • Start date Start date
C

C. L. Aitken

I have an application with a form into which data is
entered and is then closed. When closed, certain fields
are checked to make sure required data has been entered.
If a field is missing, a message box tells the user that
an entry must be made in that field. If two required
fields are empty, a second message box opens when "OK" is
clicked on the first message box.

On some desktops, the second message box opens behind the
form, which makes the system appear to have locked up
(Nothing will happen untio the user clicks "OK", but the
user doesn't see the message box so, to him, it appears
that the application is locked. If he moves the form, he
will see the message box and be able to continue.)

Does anyone have any ideas about what could cause this? (I
cannot see the form in design mode or the code behind it.)
 
For what it is worth, I have had similar problems when automating other
programs (eg. Word). One of my applications runs Word invisibly (behind the
scenes) to perform a certain task. But if Word displays a message box (eg.
"the margins of this document are set outside the printable area of the
page", or whatever), it displays *behind* the Access application, so the
user does not know it is there, & the whole shebang will grind to a halt.

My case is easier to fix than yours. In my case, Access & Word are running
asynchronously, so the Access app can use win32 APIs to detect this
situation & bring the Word message box to the front, when required. But in
your case, that would not be possible.

Two things puzzle me.

(1) Message boxes are normally displayed to the front of the displaying
application. I find it strange that the first one does, but the second one
doesn't. Are you sure that these are actually message boxes, or are they
actually forms designed to look like message boxes?

(2) It seems strange that this should happen on some desktops, but not on
others. Are you positive that the same sequence of actions, performed on the
same database (with the same data records), performs differently on
different desktops? Are you certain that both desktops have the same version
of the software? Do both desktops have the same "other" programs (if any)
running when the tests were performed?

TC
 
Actually, I have not seen the problem. My boss sent me an
e-mail telling me about it. When I couldn't make it happen
I called him and he walked me through the procedure as he
also went through it. I saw the second message box and he
didn't.

I don't know how it's generated. This is an off the shelf
application so we cannot see any of the forms in the
design mode or the code that runs the thing. We have
access to reports and any code in them and one module into
which we write any code we need. When I told him that I
needed to see the code, he told me to just check around on
the net.

Personally, I think the whole way of way of handling this
problem was stupidly done. If I were a data entry person
adding lots and lots of listings and had to deal with a
succession of message boxes that gave me one crumb of info
each, I think I take a hammer to the computer. The one
form I designed that had required fields checks the fields
and any the label for each required field that is empty
turns red and a message is displayed on the input form.

Thanks for the suggestions.
 
Yes, I agree that the succession of message boxes is not a very good way to
go. Your way is much more user-friendly.

It might be worth asking your boss whether you can actually watch him
getting the error. He might be doing something that he is not telling you
about - not because he is trying to hide it - but because he thinks that it
isn't important. But it might be causing the problem!

Good luck
TC
 
Back
Top