+ Reply to Thread
Results 1 to 3 of 3

Changing the state of Labels and textboxes in userforms

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    USA
    MS-Off Ver
    Excel 97
    Posts
    3

    Changing the state of Labels and textboxes in userforms

    I have a userform that has a couple of comboboxes. The user selects a value from combobox1 and then depending on that selection a list shows in combobox2. I want to have textboxes show up depending on the value from combobox2. Sometimes 1 textbox(textbox1) and 1 label(label1). Sometimes 2 textboxes(textbox1 and textbox2) and 2 labels(label1 and Label2). I can get it to work somewhat by making the labels and textboxes visible but I found if the user makes a selection to combobox2 and has 2 textboxes appear but then changes his mind and selects a value that only has 1 textbox the second one is always visable with the old values. How can I reset the values for the textboxes/labels when combobox2 is changed.

    Let me add that I also have values for combobox2 that don't require any additional textboxes or labels so if the user selects one of those then the label1 and 2 and textboxes 1 and 2 should be disabled and not visible.

    Hope I didn't make this too confusing.

    Thanks,
    B
    Last edited by bfischer414; 03-12-2013 at 12:58 PM.

  2. #2
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Changing the state of Labels and textboxes in userforms

    I'm not sure how the form is being used based on your description, but it sounds interesting. Can you post a workbook? There could be several ways to basically "Reset" the values based on the selection that is made by the user.

  3. #3
    Registered User
    Join Date
    03-08-2013
    Location
    USA
    MS-Off Ver
    Excel 97
    Posts
    3

    Re: Changing the state of Labels and textboxes in userforms

    Thanks for the quick reply. Sorry mine wasn't as fast. I figured it out. I had the capions=false in the wrong section. I had it when the form initialized. I moved it to the combobox_change section and then set the captions=true for certain conditions.

    Thanks again.
    B

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1