Hope this helps. It is something I found in a calendar demo
Private Function DaysInMonth(intMonth As Integer, intYear As Integer) As Integer
Dim datSta As Date, datEnd As Date
datSta = DateSerial(intYear, intMonth, 1)
datEnd = DateAdd("d", -1, DateAdd("m", 1, datSta))
DaysInMonth = DateDiff("d", datSta, datEnd)
End Function
'Called as follows:
Private Sub FindDays_Click()
Dim intDays As Long
intDays = DaysInMonth(Me.cboMonth, Me.txtYear)
'Me.cboMonth as the bound column as the No of the month - Jan = 1 etc on the form and Me.txtYear is the year on the form.
msgbox intDays
Dave