By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

Percent Data Entry in Table?

P: n/a
MX1
Hi all,

I've setup a table with one field that will hold percent values. The type
is number and the format is percent on the field. When I do data entry
directly into the field, I have to put in .03 to get 3%. If I just enter 3,
i get 300%. Is there a way to configure the table to let me type in 3 and
have it enter as 3%?

Thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The "Format" of the field is just that, formatting.

A value of 3% will be stored as 0.03 (obviously in binary) despite any
formatting used on the field.

Short answer = No

P
"MX1" <mx*@mx1.abc> wrote in message
news:P8zmb.27010$HS4.102088@attbi_s01...
Hi all,

I've setup a table with one field that will hold percent values. The type
is number and the format is percent on the field. When I do data entry
directly into the field, I have to put in .03 to get 3%. If I just enter 3, i get 300%. Is there a way to configure the table to let me type in 3 and
have it enter as 3%?

Thanks!

Nov 12 '05 #2

P: n/a
"MX1" <mx*@mx1.abc> wrote in message
news:P8zmb.27010$HS4.102088@attbi_s01...
Hi all,

I've setup a table with one field that will hold percent values. The type
is number and the format is percent on the field. When I do data entry
directly into the field, I have to put in .03 to get 3%. If I just enter 3, i get 300%. Is there a way to configure the table to let me type in 3 and
have it enter as 3%?

Thanks!

You might find it easier not to use the percent format - just remove it so
you store the numbers in the table 100 times bigger. Eg in this case, the
number would be stored as 3 not 0.03 - just display the percent sign as a
label on a form or report. Just bear this in mind if you perform any
calculations on these numbers.

Fletcher
Nov 12 '05 #3

P: n/a
Try this in the field's On Exit event, just change the txtMyNum field to the
name of your field.

Private Sub txtMynum_Exit(Cancel As Integer)
If Me!txtMynum > 0.99 And Me.Dirty Then
Me!txtMynum = Me!txtMynum / 100
End If
End Sub

You could display a message box asking the user if they want to convert the
number but this would get frustrating for the user.

Stewart
"MX1" <mx*@mx1.abc> wrote in message
news:P8zmb.27010$HS4.102088@attbi_s01...
Hi all,

I've setup a table with one field that will hold percent values. The type
is number and the format is percent on the field. When I do data entry
directly into the field, I have to put in .03 to get 3%. If I just enter 3, i get 300%. Is there a way to configure the table to let me type in 3 and
have it enter as 3%?

Thanks!

Nov 12 '05 #4

P: n/a
"MX1" <mx*@mx1.abc> wrote in message news:<P8zmb.27010$HS4.102088@attbi_s01>...
Hi all,

I've setup a table with one field that will hold percent values. The type
is number and the format is percent on the field. When I do data entry
directly into the field, I have to put in .03 to get 3%. If I just enter 3,
i get 300%. Is there a way to configure the table to let me type in 3 and
have it enter as 3%?

Thanks!


You can enter the percentages as 3%, but you must set the fieldlength
as single or double precision to get a floating point datatype in
stead of a scaled integer or decimal datatype. The notation must be
percentage of course.
the problem is probably that access rescales the entered number-value
after converting it to the target-datatype. Because floating-point
values don't loose their fractional part in this operation 3% will be
stored as 0,03 and not as 0 because of the integer-conversion /
rescaling process.

Marc
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.