|
-
Oct 16th, 2001, 08:17 PM
#1
Thread Starter
Fanatic Member
Collections problem - Resolved!!!
hi all I cant quite figure out what i have done wrong with the following code............... anybody who can point out where i have messed up would be appreciated
VB Code:
Private Sub clrTxtBoxes()
Dim frm As Form
Dim ctl As TextBox
Set frm = Form1
For Each ctl In frm
ctl.Text = ""
Next ctl
End Sub
Thanks in advance
Last edited by rudvs2; Oct 16th, 2001 at 08:30 PM.
-
Oct 16th, 2001, 08:22 PM
#2
PowerPoster
Private Sub clrTxtBoxes()
Dim ctl As TextBox
For Each ctl In Controls
ctl.Text = ""
Next ctl
End Sub
hows that?
-
Oct 16th, 2001, 08:24 PM
#3
Thread Starter
Fanatic Member
thanks beacon but still no luck i just get a type mismatch error when it trys to execute the For-Next loop
-
Oct 16th, 2001, 08:26 PM
#4
PowerPoster
Dim ctl As Control
My bad!
You may need this if your just doing text boxes:
For Each ctl In Controls
If (TypeOf ctl Is TextBox) Then
ctl.text = ""
End If
Next
-
Oct 16th, 2001, 08:29 PM
#5
Thread Starter
Fanatic Member
BINGO 
Thanks Beacon that did the trick perfectly
-
Oct 16th, 2001, 08:32 PM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|