Convert Single to Percent

C

cp2599

This is probably an easy one ... The value keeps getting rounded up.

dim sngPercent as Single
Me.Percent is defined as Percent with 2 decimals on the form

In the immediate window sngPercent = .56134553
But when I try to put it into the form field
Me.Percent = sngPercent
The result is 100%
 
J

John W. Vinson

This is probably an easy one ... The value keeps getting rounded up.

dim sngPercent as Single
Me.Percent is defined as Percent with 2 decimals on the form

In the immediate window sngPercent = .56134553
But when I try to put it into the form field
Me.Percent = sngPercent
The result is 100%

Percent is just a format, a display tool.

I suspect the the *TABLE* field to which this form control is bound is the
default Number datatype, Long Integer. An integer is by definition a whole
number.

Change the datatype of the table field to Single.

If that's not it, post back with some more details.
 
C

cp2599

Percent is just a format, a display tool.

I suspect the the *TABLE* field to which this form control is bound is the
default Number datatype, Long Integer. An integer is by definition a whole
number.

Change the datatype of the table field to Single.

If that's not it, post back with some more details.

Thank You John! Your solution resolved my problem.
 

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

pls help ammend progress bar code 4
Percent value rounds up in Access 1
2007 Percent field Issues 8
Format a Percent 4
Format a percent 7
Formatting a percent field 1
Format a percent field 1
percent format 1

Top