Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: UserForm Question

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I currently am using a userform with a MultiPage and many textboxes and comboboxes. I have a button at the bottom of the userform to reset or clear the textboxes and comboboxes. The problem is that you have to hit the button twice to work. Below is the basic code that I am using. Does anyone know how to make this work by hitting the button only once?

    UserForm1.MultiPage1.Value = 0
    UserForm1.TextBox1.Value = ""
    UserForm1.ComboBox1.Value = "bhp"

    Thanks for the help.

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

    Default

    Try clicking on the button (once) then go to the properties window and select the Default property, select true under the pop up list. if this doesnt work, reply and ill try again.
    Will

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi.
    If, when your userform is intialized, the values of these textboxes = "" then simply unload and reload your form.

    Such as

    Unload Me
    UserForm1.Show

    Think it through if you have other code in this event(initialize)

    Tom

    [ This Message was edited by: TsTom on 2002-04-01 10:00 ]

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for the help, but maybe I should better explain my problem. I have a userform that accepts information in textboxes, but the user might want to start over and clear the textboxes and reset the userform. I used the button to do this function, but you have to hit it twice to work. Is there another way of clearing and reseting information without coming out of the userform?

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    I agree with Tom if you just set the clear button to unload and then reload the userform with screen updating turned off then the user will think that the button has cleared all the data and you have the end result you want......

    ....unless you don't want the clear button to clear all the data, just some of it?

    Dan

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
  •