Just to throw my two cents in: another common cause of this error in my experience is code in the Form_Resize
event that uses math to resize controls on a form. Control dimensions (Height
and Width
) can't be set to negative values, so code like the following in your Form_Resize
event can cause this error:
Private Sub Form_Resize()
'Resize text box to fit the form, with a margin of 1000 twips on the right.'
'This will error out if the width of the Form drops below 1000 twips.'
txtFirstName.Width = Me.Width - 1000
End Sub
The above code will raise an an "Invalid property value" error if the form is resized to less than 1000 twips wide. If this is the problem, the easiest solution is to add On Error Resume Next
as the first line, so that these kinds of errors are ignored. This is one of those rare situations in VB6 where On Error Resume Next
is your friend.