Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Run-time error: Type 6

Run-time error: Type 6

Run-time error: Type 6

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!)

RE: Run-time error: Type 6

Try this one. And always check the input variables with the functions IsNumeric. If they not numeric, exit the sub

Sub cmdCompute_Click()
RT1 = (0.049*V)/((Sa*a125)+(Sa*b125)+(Sa*c125)+(Sa*d125)+(Sa*e125)
lblRT1.Caption = Format (RT1,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close