significant figures

  • Thread starter Thread starter Andy Levy
  • Start date Start date
A

Andy Levy

Hi

I have a number in a text box on my form that has about 8 significant
figures

I am calling that number into a vba function - but when i do it rounds it to
6 significant figures - which throws the calculation off course.

I have tried using CVar(me.textbox) to get it to be a variant type but to no
avail . I have tried Googleing - "vba access significant figures" but found
nothing

Any ideas

Many thanks

Andy
 
could you post any code you have?

I have tried an unbound text box that on the click of a button it multiples
the value by 3 and returns the result in a msgbox. Each time, whatever the
number, the correct answer is returned.
 
Hi

I have a number in a text box on my form that has about 8 significant
figures

I am calling that number into a vba function - but when i do it rounds it to
6 significant figures - which throws the calculation off course.

I have tried using CVar(me.textbox) to get it to be a variant type but to no
avail . I have tried Googleing - "vba access significant figures" but found
nothing

It sounds like you have this textbox bound to a table field with a
datatype of Single. A Single floating-point number is in fact limited
to approximately 7 digits precision (to plus or minus 2^-24 to be
exact). Consider changing this field to Double, which will give you
approximately 14 digits precision.
 
Hi

Thanks for your help

'The value of myTextBox on my form is 106666700.00
Debug.Print "myTextBox Value = " & Me.myTextBox

'Which produces "myTextBox Value = 1.06667E+08

So it is only showing 6 significant figures - when really i need it to show
upto 10 sig figs

Thanks

Andy
 
Oops

What i meant was

'The value of myTextBox on my form is 106666789.98
Debug.Print "myTextBox Value = " & Me.myTextBox

'Which produces "myTextBox Value = 1.06667E+08

So it is only showing 6 significant figures - when really i need it to show
upto 10 sig figs
 
Oops

What i meant was

'The value of myTextBox on my form is 106666789.98
Debug.Print "myTextBox Value = " & Me.myTextBox

'Which produces "myTextBox Value = 1.06667E+08

So it is only showing 6 significant figures - when really i need it to show
upto 10 sig figs

I can't duplicate your error, but have you tried using the Format
function? It'd be something on the order of
Format(Me.myTextBox,"0.00") for 2 decimal places.
 
Back
Top