VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple code for Calculate Number of Days in Month

by Avinash More (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 5th May 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple code for Calculate Number of Days in Month

Rate Simple code for Calculate Number of Days in Month



'Email: [email protected]

Private Sub NoOfDays(valDate As Date)
Dim CurMonth As Date
Dim NxtMonth As Date
Dim NDay As Integer

    CurMonth = valDate
    NxtMonth = DateAdd("M", 1, CurMonth)
    NDay = DateDiff("d", CurMonth, NxtMonth)
    
    MsgBox NDay
End Sub


'Example.
'Private Sub Command1_Click()
'If IsDate(Text1.Text) = False Then Exit Sub
    'Call NoOfDays(Text1.Text)
'End Sub



Download this snippet    Add to My Saved Code

Simple code for Calculate Number of Days in Month Comments

No comments have been posted about Simple code for Calculate Number of Days in Month. Why not be the first to post a comment about Simple code for Calculate Number of Days in Month.

Post your comment

Subject:
Message:
0/1000 characters