Hi all,
I am using the below code to check if fields are blank before closing the form. However it's not completely what I am trying to do as it will still close the form even if only one of the fields is blank. What I want it to do is to only close the form if ALL the fields are blank. How can I change it to make this happen?
Thanks,
Chris
I am using the below code to check if fields are blank before closing the form. However it's not completely what I am trying to do as it will still close the form even if only one of the fields is blank. What I want it to do is to only close the form if ALL the fields are blank. How can I change it to make this happen?
Code:
Private Sub Form_Unload(Cancel As Integer)
Dim ctr As Control
For Each ctr In Me.Controls
If ctr.Tag = "EmptyCheck" Then
Cancel = False
End If
Next ctr
End Sub
Thanks,
Chris