Hi everyone!
I have a form that when the user opens it, the Date combo box on the form is populated with every month of the year. But I don't want it to do that! I want it to populate with the next 3 Sundays chronologically for the user to select from. How do I need to change my code? Here's my OnLoad event for the form...
[CODE=VB]Private Sub Form_Load()
Dim intSunday As Integer
'set the rowsource type
Me.cmbDate.RowS ourceType = "Value List"
'clear the current list and set the column count to 1
Me.cmbDate.RowS ource = vbNullString
Me.cmbDate.Colu mnCount = 1
'populate the list
For intMonth = 1 To 12
Me.cmbDate.AddI tem Format(DateSeri al(Year(Now()), intMonth, 1), "mmmm")
Next intMonth
End Sub[/CODE]
I have a form that when the user opens it, the Date combo box on the form is populated with every month of the year. But I don't want it to do that! I want it to populate with the next 3 Sundays chronologically for the user to select from. How do I need to change my code? Here's my OnLoad event for the form...
[CODE=VB]Private Sub Form_Load()
Dim intSunday As Integer
'set the rowsource type
Me.cmbDate.RowS ourceType = "Value List"
'clear the current list and set the column count to 1
Me.cmbDate.RowS ource = vbNullString
Me.cmbDate.Colu mnCount = 1
'populate the list
For intMonth = 1 To 12
Me.cmbDate.AddI tem Format(DateSeri al(Year(Now()), intMonth, 1), "mmmm")
Next intMonth
End Sub[/CODE]
Comment