Hello,
I have a text box on a form that displays the result of a calculation.
My numbers are strings, converted to double during the calculation.
once converted to double, I cannot get my text box on the form to display the result using the format function.
Dim strNum1 as string
Dim strNum2 as string
strNum1 = 123.25
strNum2 = 321.25
strNum2 = Cdbl(strNum1) * Cdbl(strNum2)
Me.txtResult = Format(strNum2, "0.#######")
My result before formatting is 39594.0625
My result with formatting should be: 39594.062 (it must display 8 numbers)
When using FormatNumber(strNum2, "0.#######"), I get this error message:
Cast from string "0.#######" to type 'Integer' is not valid.
When using Format(strNum2, "0.#######"):
My text box displays: "0.#######"
PLEASE HELP!
I have a text box on a form that displays the result of a calculation.
My numbers are strings, converted to double during the calculation.
once converted to double, I cannot get my text box on the form to display the result using the format function.
Dim strNum1 as string
Dim strNum2 as string
strNum1 = 123.25
strNum2 = 321.25
strNum2 = Cdbl(strNum1) * Cdbl(strNum2)
Me.txtResult = Format(strNum2, "0.#######")
My result before formatting is 39594.0625
My result with formatting should be: 39594.062 (it must display 8 numbers)
When using FormatNumber(strNum2, "0.#######"), I get this error message:
Cast from string "0.#######" to type 'Integer' is not valid.
When using Format(strNum2, "0.#######"):
My text box displays: "0.#######"
PLEASE HELP!