G
Guest
I have a form that uses criteria from another form (fProspects) as part of
the SQL for it's record source. I've added the following code to Cancel the
form from opening if fProspects isn't open, but it still prompts for the
fields in fProspects before closing the form.
Any ideas how I can get it to Cancel the open before trying to create the
data connection?
Private Sub Form_Open(Cancel As Integer)
'close if the Prospects form is not loaded
If CurrentProject.AllForms("fProspects").IsLoaded = False Then
Cancel = True
End If
End Sub
the SQL for it's record source. I've added the following code to Cancel the
form from opening if fProspects isn't open, but it still prompts for the
fields in fProspects before closing the form.
Any ideas how I can get it to Cancel the open before trying to create the
data connection?
Private Sub Form_Open(Cancel As Integer)
'close if the Prospects form is not loaded
If CurrentProject.AllForms("fProspects").IsLoaded = False Then
Cancel = True
End If
End Sub