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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing unbound textboxes 1

Status
Not open for further replies.

Domino2

Technical User
Jun 8, 2008
475
GB
I am trying to clear unbound textboxes. I use the code below to hide certain textboxes and labels but cannot find a way to just clear them.

For Each ctl In Me.Controls
If ctl.Tag = "?" Then
ctl.Visible = False
End If
Next

What I want is something like ctl=""

Can it be done? Obviously only textboxes will be tagged for clearing, ie where tag = ??

Thanks
 
How are ya Domino2 . . .

Perhaps:
Code:
[blue]   For Each ctl In Me.Controls
      If ctl.tag = "?" Then
         ctl.Visible = False
      ElseIf ctl.tag = "??" Then
         ctl = ""
      End If
   Next[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Many thanks, that fixed it. Have a good weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top