Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 02-19-2004, 11:05 AM   #1 (permalink)
 
True Techie

Join Date: Sep 2003

Posts: 161

Cherubimon_3.20

Default Need help guys

Hey guys, im trying to make a VB application where the computer calculates the area of a circle with radius of 10. I have the text field and two command buttons. 1 to calculate the area and asnother to stop the program. Heres the code Im trying to do:

Private Sub cmdCalculate_Click()
lblAnswer.Calculate = 3.14 * 10 ^ 2 'Display area of circle of radius 10 in label'
End Sub

Private Sub cmdDone_Click()
Unload Me
End Sub

Private Sub lblMessage_Click(Index As Integer)

End Sub

Whenever i try to run the program it gives me a runtime error of 424: object required
Cherubimon_3.20 is offline  
Old 02-19-2004, 12:04 PM   #2 (permalink)
 
Banned

Join Date: May 2003

Posts: 105

imported_Jack

Default

I believe what you want to say is
lblAnswer.caption not lblAnswer.Calculate
imported_Jack is offline  
Old 02-19-2004, 02:28 PM   #3 (permalink)
 
True Techie

Join Date: Sep 2003

Posts: 161

Cherubimon_3.20

Default

I've tried that thought and it does not work.
Cherubimon_3.20 is offline  
Old 02-19-2004, 07:13 PM   #4 (permalink)
 
Monster Techie

Join Date: Jul 2003

Posts: 1,179

Emily is on a distinguished road

Send a message via AIM to Emily
Default

I ran it with lblAnswer.Caption instead of lblAnswer.Calculate and it ran fine. But... if the .Calculate were the problem, the runtime error would be that the method or data member is not found, not Object Required.

Try changing it to .Caption again and compile it, and when it gives you the error and you click OK, does it highlight a line of code or a procedure?
__________________
<a href=\"http://www.upstark.com\">www.upstark.com</a>
Emily is offline  
Old 03-01-2004, 10:10 AM   #5 (permalink)
 
Super Techie

Join Date: Dec 2003

Posts: 333

Harold III

Send a message via AIM to Harold III
Default

if .caption doesn't work for you either, I'm kinda sure that you have the wrong object. double check whether you have a LABEL control or a TextBox control. A textbox doesn't have .caption property.
__________________
I do this for Aiur. NOT YOU.
Harold III is offline  
Old 03-01-2004, 10:18 AM   #6 (permalink)
 
Banned

Join Date: May 2003

Posts: 105

imported_Jack

Default

If you press ctrl-spacebar where you would normally type the name of the object, it will allow you to pick from the controls that are on your form. That way you do not use objects that do not exist.
imported_Jack is offline  
Old 03-01-2004, 11:16 AM   #7 (permalink)
Larry's Avatar
 

Join Date: May 2003

Posts: 1,803

Larry has disabled reputation

Default

Cherubimon_3.20,
I was hoping you could shrink your signature file...
thanks

PS. cool pix
Larry is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On