Consulting

Results 1 to 7 of 7

Thread: UserForm Concept help

  1. #1
    VBAX Regular mike31z's Avatar
    Joined
    Apr 2005
    Location
    Highland, Wisconsin
    Posts
    98
    Location

    UserForm Concept help

    I am new to UserForms and would like to know is it possible to reterive various cell data after a value is intered into the first TextBox?

    Example:
    If the first TextBox has a label of Part No. and you enter that part number when you tab to the next field some of the TextBox display values based on that part number you just added.

    If this is possible.

    Then when the rest of the TextBox fields are filled can this collection of fields be saved to a new location?

    I hope I expressed myself good enough so you can understand.

    mike in wisconsin

  2. #2
    Not too sure if this is what you're after but you could try the following to build up a string based on your selection.

    This assumes you have 4 listboxes with data in and one listbox (ListBox5) to build up your selection...

    [vba]
    myRef1 = ListBox1.Value
    myRef2 = ListBox2.Value
    myRef3 = ListBox3.Value
    myRef4 = ListBox4.Value

    ListBox5.AddItem myRef1 & myRef2 & myRef3 & myRef4[/vba]

    Hope this helps.

    Cheers,
    rrenis

    Edit: Built the ListBox5 entry using Strings (Presumes you're using the same command button to progress through the Part Numbers, if not place the Dim myRefX As String at thetop of your module and addd ListBox5.AddItem myRef1 & myRef2 & myRef3 & myRef4 to each button.
    Last edited by rrenis; 05-11-2007 at 04:05 AM.

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    I would use a combobox and additem to select the part numbers but attached is a simple example that you can expand on that does what you want...I think
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    VBAX Regular mike31z's Avatar
    Joined
    Apr 2005
    Location
    Highland, Wisconsin
    Posts
    98
    Location

    UserForm error

    rrenis and lucas that you for answering my previous question.

    I hope this is the correct place to put this question

    The problem shown in the pictures went away after I closed exccel and started the lawn mower. May be the references reset them self's when I restarted excel.

    thanks any way



    When I click on the debug I get





    Mike in wisconsin
    Last edited by mike31z; 05-12-2007 at 08:28 AM.

  5. #5
    VBAX Regular mike31z's Avatar
    Joined
    Apr 2005
    Location
    Highland, Wisconsin
    Posts
    98
    Location

    UserForm

    lucas. I have looked at the userform you created and I still can not figure out how "wiget" is returned when the 555 number is added?


    mike in wisconsin

  6. #6
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    It ran for me Mike....what is the question?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  7. #7
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Mike,
    its in the textbox1 beforeupdate event:
    [VBA]If TextBox1.Text = "555-5555" Then Label2.Caption = "Wigget"[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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