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.
 

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

Back
Top