Dollar field data entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a dollar entry field in my accounting-related application. Normal fast data entry practice calls for entering 5510 for 55.10 (no decimal entered). Is there a way to allow this? Right now my data type is Currency and format is Standard, but if you enter 5510 you get 5510.00 instead of 55.10 when leaving the field
ctda
 
What you are asking to do is to divide the field by 100 if the user entered
a value with no decimal point. Use the AfterUpdate event of the text box to
search the Text property of the text box for the dot. If not found, divide
by 100.

You probably need to do this in lots of text boxes, so paste the function
below into a general module. Then set the AfterUpdate property of the text
box named "Amount" to:
=MakeCurrency([Amount])
and so on.

Function MakeCurrency(txt As TextBox)
If IsNumeric(txt.Value) Then
If InStr(txt.Text, ".") = 0 Then
txt.Value = txt.Value / 100
End If
End If
End Function


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

ctdak said:
I have a dollar entry field in my accounting-related application. Normal
fast data entry practice calls for entering 5510 for 55.10 (no decimal
entered). Is there a way to allow this? Right now my data type is Currency
and format is Standard, but if you enter 5510 you get 5510.00 instead of
55.10 when leaving the field.
 
Thanks very much Allen
ctda

----- Allen Browne wrote: ----

What you are asking to do is to divide the field by 100 if the user entere
a value with no decimal point. Use the AfterUpdate event of the text box t
search the Text property of the text box for the dot. If not found, divid
by 100

You probably need to do this in lots of text boxes, so paste the functio
below into a general module. Then set the AfterUpdate property of the tex
box named "Amount" to
=MakeCurrency([Amount]
and so on

Function MakeCurrency(txt As TextBox
If IsNumeric(txt.Value) The
If InStr(txt.Text, ".") = 0 The
txt.Value = txt.Value / 10
End I
End I
End Functio


--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.htm
Reply to group, rather than allenbrowne at mvps dot org

ctdak said:
I have a dollar entry field in my accounting-related application. Norma
fast data entry practice calls for entering 5510 for 55.10 (no decima
entered). Is there a way to allow this? Right now my data type is Currenc
and format is Standard, but if you enter 5510 you get 5510.00 instead o
55.10 when leaving the field
 
Back
Top