Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This is an easy one, adding a list to a combobox

Status
Not open for further replies.

DaveR

MIS
Feb 23, 1999
1
GB
Sorry for the basic question but I am a hacker.
I want to have a list of the months of the year to select from. Usually, because I do my work in Excel I build a name list and pull that into the ListRange property but i was wondering if their was an easier way?

thanks
Dave
 
The combobox has an AddItem method, you can do something like -

combobox1.AddItem "Jan"

- for each, or make an array containing the month names and loop through it for adding the array elements.

Hope this helps,

Dan.
 
Try this

Code:
For a = 1 To 12
List1.AddItem Format(CDate("1/" & a & "/01"), "mmm")
next a

in the form load event Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top