another event before open?

L

LGarcia

Hi all,
I've added some hot keys to open MyFormA under the condition that MyFormB
is open as well. I'm using this on the open event of MyFormA:
If CurrentProject.AllForms("MyFormB").IsLoaded = False Then
MsgBox "MyFormB must be open to view MyFormA."
DoCmd.CancelEvent
Endif
My problem is that the list box on MyFormA is asking for the parameters it
gets from MyFormB before my MsgBox appears. It seems that the list box is
running its query before the open event. Is there an event before open?
TIA,
LGarcia
 
D

Dirk Goldgar

LGarcia said:
Hi all,
I've added some hot keys to open MyFormA under the condition that
MyFormB is open as well. I'm using this on the open event of MyFormA:
If CurrentProject.AllForms("MyFormB").IsLoaded = False Then
MsgBox "MyFormB must be open to view MyFormA."
DoCmd.CancelEvent
Endif
My problem is that the list box on MyFormA is asking for the
parameters it gets from MyFormB before my MsgBox appears. It seems
that the list box is running its query before the open event. Is
there an event before open? TIA,
LGarcia

Not as far as I know. One thing you could do is leave the list box with
an empty rowsource in MyFormA as designed, and then set the rowsource to
the desired query in the Open event of MyFormA, after you've determined
that MyFormB is open.
 
L

LGarcia

That did it - Many Thanks!!

Dirk Goldgar said:
Not as far as I know. One thing you could do is leave the list box with
an empty rowsource in MyFormA as designed, and then set the rowsource to
the desired query in the Open event of MyFormA, after you've determined
that MyFormB is open.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Top