Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Form Code

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    NSW. Australia
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On a form with multiple text fields and a next command button what code would I need to clear each text box when the next command button is clicked on?

    Thanks in advance

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-30 13:14, Phil C wrote:
    On a form with multiple text fields and a next command button what code would I need to clear each text box when the next command button is clicked on?

    Thanks in advance
    You just need to clear each one, one-by-one. So:


    Private Sub NextButton_Click()
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    End Sub



    Just do that for all your textboxes that you want cleared.

    [ This Message was edited by: John McGraw on 2002-04-30 18:30 ]

  3. #3
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Or you could simply loop through each
    textbox and cler it if you have a few eg


    Dim tb As MSForms.TextBox
    For Each tb In Me.Controls
    tb.Text = ""
    Next


    Kind Regards,
    Ivan F Moala From the City of Sails

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    NSW. Australia
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thankyou John
    Works perfectly.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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