data mask

endri81

Registered User.
Local time
Today, 06:02
Joined
Jul 5, 2010
Messages
121
Hi.
How can I restrict data entry in a textbox.
I want for the user to enter only values from 740.00 to 759.99.The mask also should be something like xx.xx in the textbox.Is it possible?
 
In the field's Before Update event you could test;
Code:
If Me.FieldName > 759.99 Or Me.FieldName < 740.00 Then
     MsgBox "You Must enter a value equal to or greater then 740.00 and equal to  or less than 759.99"
     Cancel = True
     Me.FieldName = Null
     Me.FieldName.SetFocus
Endif
 
in addition,

the mask for what you need is probably going to be:
Code:
000.00
you can put that into the field at the table level or in the tbox' properties. (you may need an escape character "/" before the period to give it a literal reference...not sure)

<edit>
sorry, the mask you're looking for, if you use one, is:
Code:
000\.00
the backslash is the escape key in access.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom