issue with decimal points

A

Associates

Hi,

I have a question that i need your help with Access database. Is there a way
of limiting the decimal point to 2 when a user enters digits for number? I
believe we can use the decimal type with scale of 2. The problem with this is
it doesn't notify user of the fact that it only accepts up to 2 decimal
points. What it does is if i enter something like 234.567, it only accepts
234.56 without telling me that it's going to chop off anything beyond 2
decimal points.

I wonder if we could let them know that this only accepts 2 decimal points.
So when they enter 234.567 - they will be prompted with a message saying "it
only accepts up to 2 decimal points".

I tried to use input mask from the table level but got the error saying it
only applies to text, not number.

Thank you in advance
 
A

Allen Browne

You can use an input mask with number.
Somethin along the lines of:
#,##0.00
and so on for negatives.

If you want to examine the number of digits typed instead, examine the Text
property of the control in the BeforeUpdate event procedure of the text box
on your form. Use Instr() to locate the decimal point, and Len() to get the
total number of characters in the Text property.
 
A

Associates

Thank you for your help.

i think i might not have explained it really well. The field is actually of
type number format, not text. Therefore I can't use the mask in the form or
table because the mask doesn't work with number.

I suppose my aim here is to let them know that it only accepts number with
up to 2 decimal points. It they enters more, i want a popup dialog to tell
them to re-enter the number.

Any ideas?

Thank you in advance
 
R

ROSCECAN

Associates said:
Hi,

I have a question that i need your help with Access database. Is there a
way
of limiting the decimal point to 2 when a user enters digits for number? I
believe we can use the decimal type with scale of 2. The problem with this
is
it doesn't notify user of the fact that it only accepts up to 2 decimal
points. What it does is if i enter something like 234.567, it only accepts
234.56 without telling me that it's going to chop off anything beyond 2
decimal points.

I wonder if we could let them know that this only accepts 2 decimal
points.
So when they enter 234.567 - they will be prompted with a message saying
"it
only accepts up to 2 decimal points".

I tried to use input mask from the table level but got the error saying it
only applies to text, not number.

Thank you in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top