Placing a decimal where I want

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

Guest

I have a form that I would like the user to be able to just enter the numeric
number and I will place the decimal where it belongs. Example the number
range is from .25 to 30.75 if the user enters a 25 I want to place the
decimal in front. If the user enters a 1 I want to make it a 1.00 I've tried
setting the field to a numeric property but when I enter a 1 it doesn't keep
the zeros and of course if I enter a 25 it makes it 25. I then set the field
to a text property and tried to use the Mid statement and place the decimal
where I wanted but that didn't work, every time it gave me a 0 for an anwer
my statement was vrx = mid(vrx,2,1) = "." if someone could point me in the
correct direction I would really appreciate it.

Thanks
 
If the user enter 25 how can you tell if he wants 25 or .25, what are the
exact rules to how to define the number?

You can use the rule and sometimes devide the number by 100
On the before update event of the field, you can write the code

If (YourRule) then
Me.FieldName = Me.FieldName/100
End If
 
Back
Top