Dcooper,

Mod isn?t a function in VBA, it?s an operator. So you write 6 mod 3, just like you write 6 + 3, not mod (6,3).

And I?m afraid this means that you can?t use it in a validation rule, just as you can?t validate the value of 6 with a rule like + 3 = 9. It?s accepted as a valid syntax, but it doesn?t work.

What I should do is define a form to maintain the field, then add a BeforeUpdate event procedure like (assuming the field is named test)

Private Sub test_BeforeUpdate(Cancel As Integer)
If Me!test Mod 3 <> 0 Then Cancel = True
End Sub

Or somewhat shorter and more cryptic:

Private Sub test_BeforeUpdate(Cancel As Integer)
Cancel = Me!test Mod 3
End Sub

Or somewhat more meaningful for the user

Private Sub test_BeforeUpdate(Cancel As Integer)
If Me!test Mod 3 <> 0 Then
Msgbox (?You must enter a multiple of 3.?)
Cancel = True
End If
End Sub

This, of course, doesn?t work if you update the table directly, but it?s rather bad practice to do that in an application you write. I always use forms for the end-user, and I practically never use validation rules defined in the table.

Hope this helps.


Kees