formatting currency

K

Kristine

does anyone know how to create a table with a currency
field that automatically places the decimal 2 places to
the left
I would like to be able to enter a number without using
the decimal: enter "4605" viewed on table as 46.05
 
A

Allen Browne

And another solution - for people who don't like input masks.

1. Paste the function below into a standard module.

2. Set the AfterUpdate property of your control to:
=MakeCurrency([Amount])
where "Amount" represents the name of the control.

The function divides the entry by 100 if the user did not type a decimal
point.

------------------
Public Function MakeCurrency(ctl As Control)
'Purpose: Divide by 100 if not decimal point.

If InStr(ctl.Text, ".") = 0 Then
ctl = ctl / 100
End If
End Function
 
G

Guest

Thanks, I tried formatting an input mask using "!9999.99"
or "!9999.00" or "!####.00". Each input mask requires me
to enter a number or space. Using this format I could not
enter a dollar amount such as $46.05; I would have to
enter "space-space-4-6-0-5".
Any other suggestions? All are appreciated!
 

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