Need help with Object doesn't support this property or method Erro

A

Ayo

I am getting a "Object doesn't support this property or method" error on the
first If statement and I can't see anything wrong with the code. Can someone
give me a hand please.
Thanks.

For Each ctrl In Me.Controls
With ctrl
If .ControlType = acComboBox And .Enabled = True And .Tag <> "" Then
If Not IsNull(.Value) Then
strFilterSQL = strFilterSQL & " " & Mid(.Name, 4) & "='" &
..Value & "' AND"
End If
End If
End With
Next ctrl
 
A

Ayo

Thanks Chris

Chris O'C via AccessMonster.com said:
The control it's testing is probably a label, which doesn't have the enabled
property. Add another If-block and test for controltype before testing if
it's a combo box and enabled. The controltype property for labels is 100.

if ctrl.Properties("ControlType") <> 100


Chris
Microsoft MVP
 

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