ControlType Problem

  • Thread starter Thread starter KRISH
  • Start date Start date
K

KRISH

Hi Any body help me in solving the problem below:

Error with the following code at .ControlType is

"Method or Datamember not foud"

Dim ctr As Controls

For Each ctr In Me.Controls
If ctr.ControlType = acCheckBox Then
MsgBox "ChkBox"
End If
Next ctr

Kindly help what is the wrong in above code.

Thanks

krish
 
KRISH said:
Hi Any body help me in solving the problem below:

Error with the following code at .ControlType is

"Method or Datamember not foud"

Dim ctr As Controls

For Each ctr In Me.Controls
If ctr.ControlType = acCheckBox Then
MsgBox "ChkBox"
End If
Next ctr

Kindly help what is the wrong in above code.

Thanks

krish

The error is in this line right here:
Dim ctr As Controls

That should be

Dim ctr As Control

The variable ctr is a Control, not a Controls collection.
 
Back
Top