Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I reckun I'm going Loopy not the application

Status
Not open for further replies.

dynamictiger

Technical User
Dec 14, 2001
206
AU
I have set my reference to DAO 3.6, I have the following code

For Each ctl In Me.Controls


If ctl.Parent.Tag <> &quot;Required&quot; Then
ctl.Parent.Visible = False
End If

Debug.Print ctl.Parent.Tag



Next ctl

For whatever reason, I am sure it is simple, this keeps hanging on For each ctl in Me.Controls.

It says ctl=Nothing

I am slowly going balder
 
Make sure you declare your variable.

Declare ctl as Control

When looping, I use:

For Each ctl in Me.controls

If ctl.Tag <> &quot;Required&quot; Then
ctl.Visible = False
End If

Debug.Print ctl.Tag
next ctl

Let me know if this helps.
 
Thanks for the help. however, that doesn't work either. When I run compile it hangs on the ctl.tag=&quot;Required&quot;.

If I ignore the hang and run it then does not hang on For each ctl in Me.Controls.

If I then put the Parent word back in it hangs on the for each line.

Still going loopy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top