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

Top