VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This program will calculate your age by asking the current year

by Tristan G. Mondia (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Fri 12th April 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This program will calculate your age by asking the current year

API Declarations


Dim age As Integer
Dim input1 As String, input2 As Integer, input3 As Integer

Rate This program will calculate your age by asking the current year



End
End Sub

Private Sub cmdGo_Click()
input1 = InputBox("What is your name?:", "Name please...")
input2 = InputBox("What year were you born?:", "year please...")
input3 = InputBox("Enter current year:", "current year please...")
age = input3 - input2
lblDisplay.Caption = "You are " & input1 & " and you are " & age & " Years old"
End Sub


Download this snippet    Add to My Saved Code

This program will calculate your age by asking the current year Comments

No comments have been posted about This program will calculate your age by asking the current year. Why not be the first to post a comment about This program will calculate your age by asking the current year.

Post your comment

Subject:
Message:
0/1000 characters