Private Sub Command1_Click()
Dim FecNac As Date, Edad As Integer
FecNac = CDate(Text1)
Edad = CInt((Date - FecNac) / 365)
Text2 = Str(Edad) & "años"
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub
Private Sub Command3_Click()
Beep
End
End
Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then
MsgBox
("DIGITE LA FECHA DE NACIMIENTO")
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub
No hay comentarios:
Publicar un comentario