code won't recognize objects except combobox

Joined
Jan 29, 2007
Messages
4
Reaction score
0
Okay, so I couldn't get the AllowEdit=false to work for my form, I decided to lock all textboxes, etc. However, this is what is happening now (really weird)- the following code works for my ComboBoxes, but if I put in ANY object besides ComboBox, it doesn't work. TextBox isn't recognized...CheckBox isn't recognized...Button...etc. Any time I put any object in place of ComboBox it just skips through the code with no results. I've tried other arguments besides 'control1.Enabled=false' and still nothing. I'm not super familiar with the objects browser, but I did go in and verify that the TextBoxes were labeled as such, etc.

Any help would be appreciated. I'm pulling my hair out. All I want to do is lock down this form when a button is pushed.

AHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!

Dim control1 As Control
For Each control1 In Me.Controls

If TypeOf control1 Is ComboBox Then
control1.Enabled = False
End If

Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top