% format

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

Guest

Hello.
I have a field which I want to enter e.g. '20' and I want to show '20,00%'.
I already tried to format it to Percentage, but everytime I enter '20'
apears '2000,00%'. How can I do this?
Thank you.
Acores
 
acores said:
Hello.
I have a field which I want to enter e.g. '20' and I want to show
'20,00%'. I already tried to format it to Percentage, but everytime I
enter '20' apears '2000,00%'. How can I do this?
Thank you.
Acores

The percent format is assumed to be applied to a decimal fraction, so if
you entered ",20" you would get "20%" (or "20,00%", if you have
specified two decimal places).

If you don't want to force users to enter decimal fractions, you could
use the AfterUpdate event for the text box to change their entry by
dividing it by 100. For example,

'----- start of example code -----
Private Sub txtPercent_AfterUpdate()

If Me.txtPercent > 1,00 Then
Me.txtPercent = Me.txtPercent / 100
End If

End Sub
'----- end of example code -----
 

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

Similar Threads

Subform sintaxe 2
Actual date 1
Set a variable 3
List Box Percentage Formatting 3
Macros with code 3
Table update form a subform 3
Toolbar comand 3
Shortcut menu 1

Back
Top