So why not just change the dates in the source for the combo box?I had a combo box, but I wanted to switch because the drop down is showing dates from 2009....
Now, I am confused. I thought from your previous post you did NOT want them to able to choose dates from 2009, but now you are saying that you DO want them to, for historical reasons?I have a table with the date source and need them in case users want history. Maybe there is a sorting I can do?
Function FillComboYears(frm As Form, cbo As ComboBox, intNumberOfYears As Integer, Optional intStartYear As Integer)
Dim i As Integer
Dim strRowSource As String
frm.Controls(cbo.Name).RowSourceType = "Value List"
Do Until i = intNumberOfYears + 1
If intStartYear = 0 Then
strRowSource = strRowSource & Year(Date) - i & ";"
Else
strRowSource = strRowSource & intStartYear - i & ";"
End If
i = i + 1
Loop
frm.Controls(cbo.Name).RowSource = strRowSource
End Function
FillComboYears Me, Me.Combo6, 15
FillComboYears Me, Me.Combo6, 15, 2009