Trouble opening a modal popup form --- sometimes

M

Martureo Bob

I have an Access 2000 application with a front-end / back-end. All forms
are modal pop-ups that run maximized, being driven from buttons on the main
form. All forms, have control boxes and min/max/close buttons enabled.

When going form the main form to a secondary form, I always execute the
following sequence:

docmd.openform ...
docmd.maximize
me.visible = false

On the way back, I make the main form visible again in the secondary form's
onclose event.

This works fine and permits any of the forms to be minimzed by the user,
thus revealing the Windows Desktop (the Access Window is well hidden in the
background and is never seen).

Once in a while I have a problem when the back-end is on a server with a
wireless connection, especially when things are slow that day on the
internal network. The problem is the same whether there's only one user
logged on, or multiple users --- although with multiple users the LAN runs
slower and this problem is more noticeable.

Here's the problem.

When I issue the openform, obviously the main form continues execution to
the maximize, but the form may not even be in a shape just yet where it can
be maximized. The opening the form requires some data connections to be
established, sometimes the maximize doesn't do anything at all.

So I wind up with a modal pop-up form that's hidden! Obviously, that locks
everything up.

Is there some command I can put in between the "openform" and the "maximize"
so I can make sure the form is at least loaded before continuing.

Specifying "dialog" is definitely NOT what I want. Then I wouldn't continue
at all! I just want to ensure the form is actually loaded before
continuing.

Thanks!!!!

Bob.
 
A

Albert D.Kallal

first, you don't need the popup setting..and should get rid of it...

Further, if you just set the form as model..then you do NOT need to set the
current form visible = false..since how can the user see it anyway?

By simply using model, and a docmd.maximize, you don't need ANY code here.
In fact, if you remove the min/max buttons, then the users can't minimize
the forms..and you can even get rid of your maximize commands (except for
the first form). So, point in fact, you are coding your way through a
problem that NEEDS NO code at all!

You can read about modal, and dialog forms here

http://www.members.shaw.ca/AlbertKallal/Dialog/Index.html

The above does NOT talk about popup forms, but they are forms designed to
stay on top..and NOT necessary have the focus. So, I see no reason for you
to be using the popup setting..and it certainly is NOT for your purposes as
explained. One popup form miss-used means it STAYS on top of the ALL THE
FORMS....now you mess this up..and like a dog chasing its tail...all forms
now have to be set to popup. You don't need this..and it creates nothing but
problems....so, get rid of the popup setting..

In addition, I explain why you can't use ms-access with a wireless
connection here. Read carefully as to "why" this is not going to be
reliable.

http://www.members.shaw.ca/AlbertKallal//Wan/Wans.html
 
M

Martureo Bob

I don't think you are getting at the problem I'm having. Regarding why I
set the CALLING form to visible=false --- that's so that when the user
minimizes the CALLED form the Windows Desktop will appear. Otherwise, the
CALLING form would appear, and since these are modal, that form isn't even
active.

I've also tried to make these forms not be popups, and that does not give
the desired result.

Defining them as I have defined them (by trial and error) is the only way
that gives the desired result.

The specific timing problem is the issue at this point.

Thanks.

Bob.
 
A

Albert D.Kallal

Martureo Bob said:
I don't think you are getting at the problem I'm having. Regarding why I
set the CALLING form to visible=false --- that's so that when the user
minimizes the CALLED form the Windows Desktop will appear. Otherwise, the
CALLING form would appear, and since these are modal, that form isn't even
active.

ok...got it....
Is there some command I can put in between the "openform" and the
"maximize"
so I can make sure the form is at least loaded before continuing.

Yes...put a doevents between the two commands....
(try it...not 100% sure this will do the trick..but I think it will....).

Do note that in the forms on-open event...and even as late as the on-load
event, you can pick up the previous form

Option Compare Database
Option Explicit

dim frmPrevious As Form


Then, in the on-load event, you can go

set frmPrevious = screen.ActiveForm
frmprevious.visiable = false

Then, in the on-close...you can go

frmPrevious.Visiable = true

That way you have a generic approach to the visible stuff...and the settings
will be less likey to trip over each other....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top