About comboboxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Esk222
    New Member
    • Oct 2009
    • 2

    About comboboxes

    How do I automatically show the content of a combobox? Is that called the rowlist? When the form opens I don't want the combobax to look empty.
    Thank You,
    Anders
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    what do you mean by automatically show the content of a combobox

    What is the source of data for the combo box ?

    Comment

    • Esk222
      New Member
      • Oct 2009
      • 2

      #3
      I would like the drop-down list from the combobox to be there when I open the form.
      The source are only a few headlines (less than 10)
      Anders

      Comment

      • internetintern
        New Member
        • Oct 2009
        • 6

        #4
        Try:

        Private Sub Form_Load()

        Me.comboBox.Set Focus
        Me.comboBox.Dro pdown

        End Sub

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Originally posted by Esk222
          ...........
          The source are only a few headlines (less than 10)
          What is a headline ?

          Comment

          • smartchap
            New Member
            • Dec 2007
            • 236

            #6
            I think after adding items to combobox you need to use code like :

            Combo1.ListInde x = 0

            in the Form_Load event so that when form is loaded, item at position 1 in the combobox is automatically selected & displayed.

            Comment

            • smartchap
              New Member
              • Dec 2007
              • 236

              #7
              In this case (refer above post by me) only one item at a time will be displayed in the combobox unless dropdown button (Downward arrow button) is not pressed to display a list of items. If you want to display items in list form while form is loaded, you may use ListBox in place of ComboBox.

              Comment

              • Dököll
                Recognized Expert Top Contributor
                • Nov 2006
                • 2379

                #8
                Originally posted by Esk222
                How do I automatically show the content of a combobox? Is that called the rowlist? When the form opens I don't want the combobax to look empty.
                Thank You,
                Anders
                You probably need "Form_Load, I believe vb has a way to have us select "FORM" from the dropdown in vb design mode and form_load code would be written...

                Please search the forum, there may be something already added on this if more help needed:-)

                Comment

                Working...