VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is

by Mr. Oliver D. Siao (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 27th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is a textbox and dtpicker

Rate Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is



Dim a,b,c,d,e,f As Integer
a = DTPicker1.Year
b = DatePart("yyyy", Now)
c =(b-a) * 365.25
d = DateDiff("y", DTPicker1.Value, Now)
e = Right(Format$(c, ".00"),2)
   If e = 25 Then
      c = c + 0.75
   ElseIf e = 50 Then
      c = c + 0.5
   ElseIf e = 75 Then
      c = c + 0.25
   End If
f = b -a
If c > d Then
  f = f - 1
End if
Text1.Text = f
End Sub





Download this snippet    Add to My Saved Code

Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is Comments

No comments have been posted about Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is . Why not be the first to post a comment about Calculate Age...Using DTPicker and DatePart It's very Simple and Hope you like it. All you need is .

Post your comment

Subject:
Message:
0/1000 characters