Run-time error: Type 6
Run-time error: Type 6
(OP)
Hopefully someone can tell me what's wrong with this line of code and how to correct it.
..
Sub cmdCompute_Click()
Format (RT1, "###00.00")=(.049*V)/((Sa*a125)+(Sa*b125)+(Sa*c125)+(Sa*d125)+(Sa*e125)
lblRT1.Caption = RT1
End Sub
..
All variables (RT1, V, Sa, a125, etc.) are declared as double and values are based on user input.
I am trying to get the result of this equation to display in a label box, lblRT1.
When I run the program, a run-time error type 6 is displayed...so I click on debug and this is the line that's highlited. At first I thought it was just because the result was too big a decimal and that the "Format...." was supposed to care for that. But, alas, I am still getting the same error message.
Any help would be GREATLY appreciated.
(by the way, James, thank you for your help with my last question!)
..
Sub cmdCompute_Click()
Format (RT1, "###00.00")=(.049*V)/((Sa*a125)+(Sa*b125)+(Sa*c125)+(Sa*d125)+(Sa*e125)
lblRT1.Caption = RT1
End Sub
..
All variables (RT1, V, Sa, a125, etc.) are declared as double and values are based on user input.
I am trying to get the result of this equation to display in a label box, lblRT1.
When I run the program, a run-time error type 6 is displayed...so I click on debug and this is the line that's highlited. At first I thought it was just because the result was too big a decimal and that the "Format...." was supposed to care for that. But, alas, I am still getting the same error message.
Any help would be GREATLY appreciated.
(by the way, James, thank you for your help with my last question!)
RE: Run-time error: Type 6
Sub cmdCompute_Click()
RT1 = (0.049*V)/((Sa*a125)+(Sa*b125)+(Sa*c125)+(Sa*d125)+(Sa*e125)
lblRT1.Caption = Format (RT1,