Form Events - Error OnCurrent

Elana

Registered User.
Local time
Today, 12:53
Joined
Apr 19, 2000
Messages
232
I have a form (frmAPRP) that can only be opened if another form (frmChanges) is open. My "on Load" event for frmAPRP states:

"If IsNull(Me.OpenArgs) Then
MsgBox "This form must be opened from within another form", vbCritical, "Cannot Open Form"
DoCmd.Close acForm, Me.Name
End If"

All works okay to this point; however, my "onCurrent" event for frmAPRP still appears to be firing, even though I have closed the form in the OnLoad event. This generates an error because I pass values to two fields in the OnCurrent event, assuming the frmChanges is open.

Am I missing something? Why would the OnCurrent still fire after I have closed the form in the previous procedure?

Thanks for any help you can give me that will steer me in the right direction.



[This message has been edited by Elana (edited 10-10-2001).]
 
I'm not sure about the sequence of events being triggered in this scenario, but maybe you can set a public variable (ie blnLoaded) to false in the OnLoad event and then check this value in the OnCurrent event.

HTH
SteveA
 

Users who are viewing this thread

Back
Top Bottom