Consulting

Results 1 to 5 of 5

Thread: Combobox linked to Listbox

  1. #1
    VBAX Regular
    Joined
    May 2011
    Posts
    46
    Location

    Combobox linked to Listbox

    Hello all,

    I am working on a userform that is linked to a Listbox.
    By selecting a record from the listbox and hitting the "EDIT"-button the userform can be accessed.

    At this moment the user is able to edit the values of textboxes and save it.
    However I like to use a combobox for the "post"
    The range from which the user can choose should be M2:M
    when saved it should be stored in range L:L on sheet "Database"

    Important is that when the userform is called again it initializes the chosen "post".

    I hope this all make any sense.
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just change it to a combobox, and set the RowSource to M2:M6.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    May 2011
    Posts
    46
    Location
    Quote Originally Posted by xld
    Just change it to a combobox, and set the RowSource to M2:M6.
    Thanks xld, that solved the "populate combobox" part.
    But how do I initialize it with the selected item from the listbox?

  4. #4
    VBAX Regular
    Joined
    May 2011
    Posts
    46
    Location
    Perheps someone else?

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    In the initialise

    [vba]
    ComboBox1.ListIndex = -1[/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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