|
-
Jul 25th, 2011, 02:58 PM
#11
Re: [RESOLVED] Runtime error '91': Object variable or with block not set
 Originally Posted by Ehwenomare
Here is what I did:
Code:
Private Sub cmdcalculate_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
If ctl.Visible = True And ctl.Text = "" Then
MsgBox "Please make a selection"
Flash
Exit Sub
End If
If Not IsNumeric(ctl.Text) And ctl.Visible = True Then
MsgBox "You must enter numeric value"
Flash
Exit Sub
End If
End If
If TypeOf ctl Is ComboBox Then
If ctl.Visible = True And ctl.ListIndex = -1 Then
MsgBox "Please make a selection"
Exit Sub
End If
End If
Next ctl
Sorry but in my description in #8 I made a mistake in my directions but it's one that you could have probably figured out. Look at the Flash Sub. From its heading you see that it needs a parameter which is the control to flash, so where you put 'Flash' in your code change it to 'Flash Ctl'.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|