another event before open?

  • Thread starter Thread starter LGarcia
  • Start date Start date
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
 
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.
 
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)
 

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

Back
Top