VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Getting your exact age just in a simple code

by Ednalin D. Layugan (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 3rd May 2009
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Getting your exact age just in a simple code

API Declarations


' Create/Draw a textbox in your form for your age

Rate Getting your exact age just in a simple code



'Bauan East, Solana, Cagayan Philippines 3503
'[email protected]

Private Sub txtbday_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsDate(txtbday.Text) Then
txtage.Text = Int(DateDiff("d", txtbday.Text, Date) / 365.25)
Else
    MsgBox "Enter the correct date format, mm/dd/yyyy"
    txtbday.Text = ""
End If
End If
End Sub


Download this snippet    Add to My Saved Code

Getting your exact age just in a simple code Comments

No comments have been posted about Getting your exact age just in a simple code. Why not be the first to post a comment about Getting your exact age just in a simple code.

Post your comment

Subject:
Message:
0/1000 characters