Connecting Tech Pros Worldwide Forums | Help | Site Map

About comboboxes

Newbie
 
Join Date: Oct 2009
Posts: 2
#1: Oct 4 '09
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's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,507
#2: Oct 4 '09

re: About comboboxes


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

What is the source of data for the combo box ?
Newbie
 
Join Date: Oct 2009
Posts: 2
#3: Oct 5 '09

re: About comboboxes


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
Newbie
 
Join Date: Oct 2009
Posts: 6
#4: Oct 7 '09

re: About comboboxes


Try:

Private Sub Form_Load()

Me.comboBox.SetFocus
Me.comboBox.Dropdown

End Sub
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,507
#5: Oct 7 '09

re: About comboboxes


Quote:

Originally Posted by Esk222 View Post

...........
The source are only a few headlines (less than 10)

What is a headline ?
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194
#6: Oct 9 '09

re: About comboboxes


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

Combo1.ListIndex = 0

in the Form_Load event so that when form is loaded, item at position 1 in the combobox is automatically selected & displayed.
smartchap's Avatar
Familiar Sight
 
Join Date: Dec 2007
Location: Lucknow, India
Posts: 194
#7: Oct 9 '09

re: About comboboxes


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.
Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,268
#8: Oct 10 '09

re: About comboboxes


Quote:

Originally Posted by Esk222 View Post

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:-)
Reply