Or, for a friendlier approach (the Access Gnomes can be very abrupt!)
Code:
Private Sub AgeField_BeforeUpdate(Cancel As Integer)
If Me.AgeField < 18 Then
MsgBox Me.AgeField & " Is Not Valid Age for this Field!"
Cancel = True
AgeField.SelStart = 0
AgeField.SelLength = Len(Me.AgeField)
End If
End Sub
Just replace AgeField with the actual name of your 'age' Control.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007