hardhitter06
Registered User.
- Local time
- Yesterday, 20:33
- Joined
- Dec 21, 2006
- Messages
- 600
Hi All,
I have a form where all fields are required except comments or record will not save. If they are filled out properly, then it will display "record saved"
Comments is my last field on the form and i have this code
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.ControlType = acTextBox Then
If IsNull(ctrl) Then
MsgBox ctrl.Name & " Cannot Be Left Empty!"
Cancel = True
ctrl.SetFocus
Exit Sub
End If
End If
Next
MsgBox "Record Saved!"
End Sub
I just want to modify this so that it ignores the Comments field since no data has to be entered.
I have a form where all fields are required except comments or record will not save. If they are filled out properly, then it will display "record saved"
Comments is my last field on the form and i have this code
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.ControlType = acTextBox Then
If IsNull(ctrl) Then
MsgBox ctrl.Name & " Cannot Be Left Empty!"
Cancel = True
ctrl.SetFocus
Exit Sub
End If
End If
Next
MsgBox "Record Saved!"
End Sub
I just want to modify this so that it ignores the Comments field since no data has to be entered.