%

  • Thread starter Thread starter Chi Huynh
  • Start date Start date
C

Chi Huynh

Hi,
In my data entry form, I have a field named percentage
discount.
The problem is when I entered 10%, it automatically
changed to 1000%.

If I entered 0.10, it is ok (it will show 10%)

I think that it is not convenience for users. Therefore,
please show me how to fix the problem.


Thank you
Chi Huynh
 
Chi,

You could use the Before Update event of the control on your data entry form
to automatically divide the user entry by 100, so the user still keys 10,
and Access changes it to 0.1, which displays 10%.
You can do so by means of a macro:
Action: SetValue
Arguments:
Item: ControlName
Expression: [ControlName] / 100
Condition: [ControlName] <>0

Or a single line of vbCode:
If Me.ControlName <> 0 Then Me.ControlName = Me.ControlName / 100

In any case, just change ControlName to the actual name of your control.

HTH,
Nikos
 
Back
Top