Entering a percent

  • Thread starter Thread starter Jim Orson
  • Start date Start date
J

Jim Orson

Hi,

How do I enter a number directly as a percent in a form? If I enter 4.5 for
example, I want to display the number as 4.5% and store it as .045 for
report calculations. As it is now, I have to enter .045 to get the number
to display as 4.5% and store in the table as .045. Is there a setting I
need to change?

Thanks for help.

Jim...
 
For 100% and below, add this AfterUpdate procedure to
your text box on your form:

Sub MyTextBox_AfterUpdate()
If MyTextBox>1 then
MyTextBox=MyTextBox/100
End If
End Sub

Denny G.
 
Be sure to format the text box on your form as Percent in
the form's properties, and be sure to enter the percent
sign after entering the number or you will get an error
message.

Denny G.
 
Denny G.

Hmmm. As I said in my other post, it works fine. Yes, the text box format
is set to Percent. But, I get no error message when I enter data without
the percent sign. I did change the sub by eliminating the if statement and
just using the /100 statement. I wanted it valid for all input, not just
greater than 1.
BTW, I am using Access 2003 if that means anything.

Jim...
 
Back
Top