I use a sub for such things called in the OnEnter event of the combo.
You can adjust the future/past months to display using the arguments.
Code:
Public Sub Dates4Combo(Cbo As ComboBox, Optional FutureMonths As Integer = 1, _
Optional MonthsToDisplay As Integer = 3, Optional DefaultCurrentMonth As Boolean = True)
Dim dte As Date
Dim i As Integer
dte = DateAdd("m", FutureMonths, Date)
Cbo.RowSource = ""
Cbo.Value = Null
For i = 1 To MonthsToDisplay
Cbo.AddItem Format(dte, "mmm yyyy")
dte = DateAdd("m", -1, dte)
Next i
If DefaultCurrentMonth = True Then
Cbo.Value = Format(Date, "mmm yyyy") ' default selected month to current month
End If
End Sub
Code:
Private Sub cboMonths_Enter()
Dates4Combo Me.cboMonths
End Sub
Code:
Private Sub cboMonths_Enter()
Dates4Combo Me.cboMonths, 6, 13
End Sub