Hardly any code and look mom "No variables":

VB Code:
  1. Function GetMonthDays(MonthToCheck As Date) As Integer
  2.     GetMonthDays = Day((DateAdd("m", 1, Format(MonthToCheck, "mm/yyyy"))) - 1)
  3. End Function

and call it like this:

VB Code:
  1. Private Sub Command1_Click()
  2.     MsgBox GetMonthDays("02/23/2004")
  3. End Sub