Hi guys, good day, just want to ask if there's a function that determines the number of days in a month, In a Roman Calendar, the days in a month are either 30 or 31, but if it's a leap year(every 4 years) the month of February is 29 instead of 28...

my another problem is this:
I'm making an [issue date] of books and [deposit date] of books...
the issue date will get the current [month,day, and year] of the system time. The Deposit date will add 5 days from the current month,day and year...

For Example:

Today is: 10/15/2009(October 15, 2009)
Now when the the TextBox, lets say its name is 'txtIssueDate' its value is the current month,day and year, when the TextBox lost the focus and the focus go to another textbox, let's say its name is 'txtDepositDate', when this textbox got the focus, the date value in txtIssueDate will automaticaly increase by five,

IssueDate: 10/15/2009
DepositDate: 10/20/2009

but when the month changes...
(Months number of days are either 30 or 31)

IssueDate: 10/31/2009
DepositDate: 11/05/2009-month increases

Now when the year ends..

IssueDate: 12/31/2009
DepositDate: 01/05/2010-the year increases

Don't forget the leap year....when it's a leap year the number of days of the month 'February' is 29 instead of 28....

3
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by elkhartlynn

Dim LastDayOfMonth As Integer
LastDayOfMonth = Day(DateAdd("d", -1, Month(Now) + 1 & "/1/" & Year(Now)))

Good Luck

Thank you for your time and effort for solving my problem! :)

The DateAdd function will work without having to worry about how many days are in the current month.

``txtDepositDate.text=DateAdd("d",5,Now())``