im making a program that gives you the age of the person that enters there date of birth
the code i got at the moment is:
Private Sub Command1_Click()
Dim age As String
age = Month(Now) - Text4.Text
If age < 0 Then
age = 1
Else
age = 0
End If
Text3.Text = ""
Text3.Text = Text3.Text & "Name: " & Text1.Text & vbCrLf
Text3.Text = Text3.Text & "Gender: " & Text6.Text & vbCrLf
Text3.Text = Text3.Text & "Date of Birth: " & Format(Text2.Text, "##") & "/" & Format(Text4.Text, "##") & "/" & Format(Text5.Text, "####") & vbCrLf
Text3.Text = Text3.Text & "Age: " & (Year(Now) - Format(Text5.Text, "####")) - age & vbCrLf & vbCrLf
Text3.Text = Text3.Text & "Age in Months: " & ((Year(Now) - Format(Text5.Text, "####")) - age) * 12 + Text4.Text & vbCrLf
Text3.Text = Text3.Text & "Age in Weeks: " & Int(((Year(Now) - Text5.Text) * 52) + (((Month(Now) - 1) - Text4.Text) * 4)) & vbCrLf
End Sub
Private Sub Text6_Change()
Text6.Text = UCase(Text6.Text)
TicketClass = Text6.Text
Select Case TicketClass
Case "F"
Text6.Text = "Femail"
Class = True
Case "M"
Text6.Text = "Male"
Class = True
End Select
End Sub
i need to know if this is right and what i can do for the days hours minuets seconds etc.