Results 1 to 3 of 3

Thread: Syntax for clearing Textboxes

  1. #1
    Guest

    Post

    I want to use something like this:
    For i = Forms.Count - 1 To 1 Step -1
    Unload Forms(i)
    Next

    Is there a way to so this with all the textbox controls instead of forms?

  2. #2
    Guest

    Post

    Option Explicit

    Private Sub Form_Load()
    Dim ctl As Control
    For Each ctl In Form1.Controls
    If TypeOf ctl Is TextBox Then
    ctl.Text = ""
    End If
    Next
    End Sub

  3. #3
    Guest

    Post

    Many thanks! This is exactly what I was looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width