Create an event procedure in the Before Update event of the text box and add code that looks like this:
Code:
Dim intRemainder As Integer
If Not IsNull(Me!txtMyText) Then
intRemainder = Me!txtMyText Mod 6
If intRemainder <> 0 Then
MsgBox "Invalid data. Value must be a multiple of 6."
DoCmd.CancelEvent
SendKeys "{ESC}"
End If
End If
... where "txtMyText" is the name of your text box. You'll also want to set the format of your field to a number type and/or set an input mask or otherwise test for non-numeric data in the field so you don't get type mismatch errors.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.