A simple program that will ask the user to give a year and then our program will check if the given year is a leap year or not a leap year using Microsoft Access.
I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.
My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.
Sample Program Output
Program Listing
Option Compare Database
Function IsLeapYear(Optional varDate As Variant) As Boolean
If IsMissing(varDate) Then
varDate = Year(Now)
ElseIf VarType(varDate) = vbDate Then
varDate = Year(varDate)
ElseIf VarType(varDate) = vbInteger Then
If varDate < 100 Or varDate > 9999 Then
varDate = Year(Now)
End If
Else
varDate = Year(Now)
End If
IsLeapYear = (Day(DateSerial(varDate, 2, 28) + 1) = 29)
End Function
Private Sub Command16_Click()
Dim a As Integer
If Len(Trim(Me.Text13) & vbNullString) = 0 Then
MsgBox "Enter the a Year", vbInformation
Me.Text13.SetFocus
Exit Sub
End If
a = Val(Me.Text13)
If IsLeapYear(a) = True Then
Me.Label15.Caption = "The given year " + Str(a) + " is a Leap Year."
Else
Me.Label15.Caption = "The given year " + Str(a) + " is Not a Leap Year"
End If
End Sub
Private Sub Command17_Click()
Me.Text13 = ""
Me.Label15.Caption = ""
Me.Text13.SetFocus
End Sub
Private Sub Command18_Click()
DoCmd.OpenForm "frmAbout"
End Sub