form pre-processing

ajm

Registered User.
Local time
Today, 15:15
Joined
Oct 6, 2006
Messages
16
Hi
I have some code in a function that I want to run BEFORE a form (FormB) is displayed to the user.
FormB is called up by clicking on a button from another form (FormA), but when I display the ActiveForm . . .
Dim MyFormPO As Form
Set MyFormPO = Screen.ActiveForm
MsgBox "here!!-" & MyFormPO.Name
. . . I get the form name of FormA, and it errors-out because the objects I'm trying to reference do NOT exist in the Active form.
I've tried calling the function from every Form event ("OnOpen", "onLoad", "OnActivate" etc,,) but ActiveForm always seems to be the first form.
Anyone any ideas, please
Thanks
ajm
 
I'm curious as to why you're even referencing the activeform? Any code you put in the 'OnOpen' event of FormB will run against FormB only.
 

Users who are viewing this thread

Back
Top Bottom