month in combo box

kermit

Registered User.
Local time
Today, 12:08
Joined
Dec 20, 2002
Messages
12
i am trying to create a combo box that has the next twelve months as its recordsource. So if you select the combo box now in the month of February the box will have february - january, but when the next month rolls around i would like it to automatically change its recordsource to have march - february. I have tried some value lists using date functions, but i cant get it to work the way im looking for.

Any Ideas?

Thanks-
Kermit-
 
i dont know if access has a built in function you can use
but you could try this if you like
in your forms on current event
Dim CB As ComboBox
Set CB = Me![cb4] ' replace this with your combo box name
Dim MonthNo As Long
Dim StrSql As String
MonthNo = DatePart("m", Date)
Select Case MonthNo
Case 1 'january
StrSql = "February" & ";March" & ";April" 'etc etc
Case 2 'feb
StrSql = "March" & ";April" & ";May" & ";June" 'etc etc
Case 3 'march

Case 4

Case 5

Case 6

Case 7

Case 8

Case 9

Case 10

Case 11

Case 12
End Select
CB.RowSource = StrSql
[CB].Requery
 

Users who are viewing this thread

Back
Top Bottom