Listing the last and 15th day of every month in a combo box.
Posted on 2011-04-24
I have issues getting this code work. I have been able to link it to a fill box and generate the dates but only either the 15th of each month is listed or the last day of the month. Below is the code I have been working on. any help is very much appreciated.
Function ListMondays(fld As Control, id As Variant, _
row As Variant, col As Variant, code As Variant) _
Dim intOffset As Integer
Dim temp As Integer
temp = 0
Select Case code
Case acLBInitialize ' Initialize.
ListMondays = True
Case acLBOpen ' Open.
ListMondays = Timer ' Unique ID.
Case acLBGetRowCount ' Get rows.
ListMondays = 10
Case acLBGetColumnCount ' Get columns.
ListMondays = 1
Case acLBGetColumnWidth ' Get column width.
ListMondays = -1 ' Use default width.
Case acLBGetValue ' Get the data.
'ListMondays = DateSerial(Year(Date), Month(Date) + 1 + row, 1) - 1
'ListMondays = "mm/dd/yyyy"
'intOffset = Abs((9 - Weekday(Now)) Mod 7)
Select Case temp
Case Abs((temp) Mod 2) = 0
ListMondays = DateSerial(Year(Date), Month(Date) + temp, 1) - 1
'row = row + 1
'ListMondays = DateSerial(Year(Date), Month(Date) + temp, 1) + 14
Case Abs((temp) Mod 2) = 1
ListMondays = DateSerial(Year(Date), Month(Date) + row, 1) + 14
temp = temp + 1