BerkshireGuy wrote:
Is there a way to setup an input mask to be a range of numbers? For
instance, only allowing 1,2,3,4 or just 1 or 2. Or should I just do a
test in the BeforeUpdate event of the control?
If this is to be the case fr all values of a field, consider using the
validation rule for the approprite field in the table design window:
1 or 2 or 3 or 4
or
=1 and <=4
You can also use the validation text to explain to a user what's wrong.
To do it on the form, if you do it in the beforeupdate event (air code):
Private Sub txtMyField(Cancel As Integer)
if isnumeric(me.txtMyField.text) = false then
msgbox "Enter a number from 1 to 4!"
cancel = true
elseif me.txtMyfield.Text < 1 or _
me.txtMyfield > 4 then
msgbox "Enter a number from 1 to 4!"
cancel = true
end if
End Sub
You can probably think of neater ways to do the code above.
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me