Public Function GetMonthDays(ByVal dDate As String) As Integer
    Dim dNext As Date
    Dim dTemp As Date
    Dim dCur As Date
    
    dTemp = DateAdd("m", 1, dDate)
    dNext = DateSerial(Year(dTemp), Month(dTemp), 1)
    dCur = DateSerial(Year(dDate), Month(dDate), 1)
    GetMonthDays = DateDiff("d", dCur, dNext)
End Function