CodeItBetter Programming Another VB Programming Blog

How to generate list in combobox with all dates of current month

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'Date & Time - How to generate list in combobox with all dates of current month
Option Explicit
 
Private Sub Form_Load()
    Call GenerateComboList(Combo1)
End Sub
 
Public Sub GenerateComboList(cbo As ComboBox)
    Dim I As Long
    For I = 0 To 30
        cbo.AddItem DateAdd("d", I, Date)
        'Or
        'cbo.AddItem Date + I
    Next I
    cbo.ListIndex = 0
End Sub
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.