M
MechEngr
Greetings, I am looking for a little help with looping controls in VBA. I
have two loops below... the first one works and the second does not.
This loop in in a module attache to a form and does not use Option Explicit.
this works:
<Dim ctl As Control
Dim temp As String
For Each ctl In Forms!frmMembership_Manager!subfrmFilters.Controls
If ctl.Tag = "FilterCheck" Then ctl.Value = 0
Next ctl>
This loop is in an independent module and does use Option Explicit. This
does not work. I get an error message "Object does not support this Property
or Method". The error occurs in the body of the “For Loopâ€.
<Dim intI As Integer
Dim ctl As Control
For Each ctl In Forms!frmMembership_Manager!subfrmFilters.Controls
If ctl.Tag = "FilterCheck" And ctl.Value = -1 Then intI = intI + 1
Next ctl>
Any help offered is appreciated in advance.
have two loops below... the first one works and the second does not.
This loop in in a module attache to a form and does not use Option Explicit.
this works:
<Dim ctl As Control
Dim temp As String
For Each ctl In Forms!frmMembership_Manager!subfrmFilters.Controls
If ctl.Tag = "FilterCheck" Then ctl.Value = 0
Next ctl>
This loop is in an independent module and does use Option Explicit. This
does not work. I get an error message "Object does not support this Property
or Method". The error occurs in the body of the “For Loopâ€.
<Dim intI As Integer
Dim ctl As Control
For Each ctl In Forms!frmMembership_Manager!subfrmFilters.Controls
If ctl.Tag = "FilterCheck" And ctl.Value = -1 Then intI = intI + 1
Next ctl>
Any help offered is appreciated in advance.