Peter Paul
Registered User.
- Local time
- Today, 17:16
- Joined
- Jan 1, 2000
- Messages
- 82
I am attemtping to write the proper code to get a form to not open if there are no results listed on it. It opens automatically. The form is called Overdue, there is a subform on it called Numbers Subform1 and the field I am looking in to see if it is null is Case_Incident_Number. I cannot seem to get this right.
In the OnOpen property for the main form I have tried something like this:
Private Sub Form_Open(Cancel As Integer)
If Forms!Overdue![Numbers subform1].Case_Incident_Number Is Null Then
DoCmd.Close , Form!Overdue, acSaveNo = acSavePrompt
End If
End Sub
Where am I screwing this up, and is there a better way to achieve my goal? I have several instances where I would like to run a similar procedure.
Thanks as always,
Peter Paul
In the OnOpen property for the main form I have tried something like this:
Private Sub Form_Open(Cancel As Integer)
If Forms!Overdue![Numbers subform1].Case_Incident_Number Is Null Then
DoCmd.Close , Form!Overdue, acSaveNo = acSavePrompt
End If
End Sub
Where am I screwing this up, and is there a better way to achieve my goal? I have several instances where I would like to run a similar procedure.
Thanks as always,
Peter Paul