Run time error

100 pts.
Tags:
VB6
When i run a progress bar in VB I get message "Run time error 380 Invalid property value" how to solve this

Software/Hardware used:
VB6, ACCESS
ASKED: January 30, 2010  2:12 PM
UPDATED: February 4, 2010  2:40 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Most likely you are assigning a value outside the valid range (0 – 100) to the ‘value’ property.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Adwaith
    I have given range 0 to 50. The code "Pb.value=pb.value+1 is highlighted as run time error
    100 pointsBadges:
    report
  • carlosdl
    We would need to see the complete code to try to help. Are you sure the loop is not going farther than 100 interations ? To debug it, try adding some code like this, replacing the line that is causing the error:
    If Pb.value >= 100 then
    	MsgBox("Value is already 100")
    else
    	Pb.value=pb.value+1
    End If
    65,110 pointsBadges:
    report
  • Adwaith
    I have set Max as 50 and Min as 0 and the code is this Private Sub Timer1_Timer() PB.Value = PB.Value + 1 -> (After pb reaches max it displays as per code but then shows the run time error highlighting this line of code) If PB.Value = 5 Then Label3.Visible = True If PB.Value = 10 Then Label3.Visible = False If PB.Value = 15 Then Label3.Visible = True If PB.Value = 20 Then Label3.Visible = False If PB.Value = 25 Then Label3.Visible = True If PB.Value = 30 Then Label3.Visible = False If PB.Value = 35 Then Label3.Visible = True If PB.Value = 45 Then Label3.Visible = False If PB.Value = 49 Then Label3.Visible = True PB.Visible = False Label5.Visible = False End If End Sub
    100 pointsBadges:
    report
  • carlosdl
    I think I understand the problem now. You assigned min and max through the control properties. When you do that, you are setting the valid range, but that doesn't stop you from trying to assign values outside that range, so you have to make sure that doesn't happen. You have to check the value you are going to assign. Something like this:
    Private Sub Timer1_Timer()
    	If PB.Value < PB.max Then
    		PB.Value = PB.Value + 1 -> (After pb reaches max it displays as per code but then shows 
    	Else
    		'Something else
    	End If
    	If PB.Value = 5 Then Label3.Visible = True
    	...	
    	...
    End Sub
    
    65,110 pointsBadges:
    report
  • Adwaith
    Thank you that solved my problem
    100 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following