Hi
Is this of any help?
From any date (TakeADate), get FYstartDate and FYlastDate:
If you are starting with a TextBox Date as a String then
TakeADate = CDate(TextBox1.Text). In any case, starting with a valid Date:
' take any date
Dim TakeADate As Date = Now.AddMonths(-1).Date
' make start date with same month and year
Dim FYstartDate As Date = New Date(TakeADate.Year, TakeADate.Month, 1)
' find last day
Dim FYlastDate As Date = FYstartDate.AddMonths(1).AddDays(-1)
' find days in a month
Dim DaysInMonth As Integer = DateTime.DaysInMonth(TakeADate.Year, TakeADate.Month)