Link to home
Start Free TrialLog in
Avatar of se2welch
se2welch

asked on

Validation rule needed to force 2 decimal place entry in Access 2003


Hi.

I'm trying to get a field in Access to only accept entry of 2 decimal places (eg 1.85) and to reject a user attempt to enter 1.851 or 1.8.

I've tried using setting the field to be a number and using a validation rule (Like "#.##"), and this works to a certain extent, but also rejects numbers with a trailing zero such as 1.80.

Changing the field to be a text field and using the ("Like "#.##") validation works, but it forces the user to enter any leading zeros (eg. 0.80) which isn't ideal.

Any ideas?
 
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Hi se2welch,

Use an input mask "0.00"


Good Luck!

Gary
Avatar of se2welch
se2welch

ASKER


Hi Gary,

Thanks for the post, however an input mask will only work when the field is a text field and requires the same leading zero as my solution of changing the field to be a text field and using the ("Like "#.##") validation.  I was hoping there might be a way to do it and leave it as a number field.
ASKER CERTIFIED SOLUTION
Avatar of tbsgadi
tbsgadi
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Ahh.  It's just the imput mask wizard that only works for text and date!  Thanks so much!