Wednesday, January 17, 2018

Leap Year Checker in Microsoft Access

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 mobile number here in the Philippines is 09173084360.

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







Prime Number Checker in Microsoft Access

In this article I would like to share with you a sample program that will ask the user to give a number and then our program will check if the given number in prime number or not using Microsoft Access. I am using Microsoft Access 2010 in writing this program.

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.








Sample Program Output



Program Listing

Option Compare Database

Public Function PrimeNumberChecker(sinput) As Boolean
    PrimeNumberChecker = True
    If sinput = 1 Then
        PrimeNumberChecker = False
    ElseIf sinput > 2 Then
        For i = 2 To sinput - 1
            If sinput Mod i = 0 Then
                PrimeNumberChecker = False
                Exit Function
            End If
        Next i
    End If
End Function

Private Sub Command16_Click()
Dim a As Integer


If Len(Trim(Me.Text13) & vbNullString) = 0 Then
     MsgBox "Enter the a Number", vbInformation
     Me.Text13.SetFocus
     Exit Sub
End If

a = Val(Me.Text13)

If PrimeNumberChecker(a) = True Then
   Me.Label15.Caption = "The given number " + Str(a) + " is a Prime Number."
Else
  Me.Label15.Caption = "The given number " + Str(a) + " is Not a Prime Number."
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



Saturday, January 6, 2018

Temperature Converter in Microsoft Access

I created a program using Microsoft Access 2010 I called this program Temperature Converter it has two options the first one is Fahrenheit To Celsius and the other one is Celsius To Fahrenheit. It will ask the user to give temperature value and then our program will convert the given value. I hope you will find my work useful.

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.






Sample Program Output


Program Listing

' Temperature Converter in Microsoft Access 2010
' Written By Mr. Jake R. Pomperada, MAED-IT
' January 6, 2018  Saturday
' jakerpomperada@yahoo.com and jakerpomperada@gmail.com
' Bacolod City, Negros Occidental Philippines

Option Compare Database

Private Sub Command17_Click()
Me.Option2.Value = ""
Me.Option6.Value = ""
Me.Option2.Enabled = True
Me.Option6.Enabled = True
Me.Label18.Caption = ""
Me.txt_temp = ""
Me.txt_temp.SetFocus
End Sub


Private Sub Command19_Click()
Dim Sure As Integer

Sure = MsgBox("Are you sure?", vbOKCancel)
If Sure = 1 Then
DoCmd.Quit
Else
 DoCmd.OpenForm "temp"
 Me.txt_temp.SetFocus
End If
End Sub

Private Sub Command8_Click()
Dim temp As Double
Dim Result_Fahrenheit As Double
Dim Result_Celsius As Double

temp = Val(Me.txt_temp)

If Len(Trim(Me.txt_temp) & vbNullString) = 0 Then
     MsgBox "Enter temperature value please.", vbInformation
     Me.txt_temp.SetFocus
     Exit Sub
End If
  Result_Fahrenheit = ((temp * 9) / 5) + 32
  
  Result_Celsius = ((temp - 32) * 5) / 9

If Me.Option2.Value = True Then
Me.Label18.Caption = "Temperature is " + Str(Round(Result_Celsius, 2)) + " Degree's Celsius."
End If

If Me.Option6.Value = True Then
Me.Label18.Caption = "Temperature is " + Str(Round(Result_Fahrenheit, 2)) + " Degree's Fahrenhiet."
End If

End Sub

Private Sub Form_Load()
Me.Option2.Value = ""
Me.Option6.Value = ""
End Sub

Private Sub Option2_AfterUpdate()
If Me.Option2.Value = True Then
Me.Option6.Enabled = False
End If
End Sub

Private Sub Option6_AfterUpdate()
If Me.Option6.Value = True Then
Me.Option2.Enabled = False
End If
End Sub








Friday, January 5, 2018

Word Counter in Microsoft Access

A very simple program that I wrote using Microsoft Access to ask the user to give a string or a sentence and then our program will count the number of words in the given sentence. 

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.







Sample Program Output



Program Listing

'Count Words in a Sentence in Microsoft Access
' Written By Mr. Jake R. Pomperada, MAED-IT
' January 5, 2018  Frinday

Option Compare Database

Public Function WordCounter(Text As String) As Integer
Dim Counts As Integer
Dim dupText As String
dupText = Replace(Trim(Text), vbNewLine, " ")
If dupText = "" Then
    Counts = 0
Else
    Counts = 1
    For i = 1 To Len(dupText)
        If Mid(dupText, i, 1) = " " Then ' use Mid to search space
            If Mid(dupText, i - 1, 1) <> " " Then
                Counts = Counts + 1
            End If
        End If
    Next
    
Me.Label15.Caption = "Total number of words is " + Str(Counts) + "."
End If

End Function
Private Sub Command16_Click()
Dim word_count As Integer

If Len(Trim(Me.Text13) & vbNullString) = 0 Then
     MsgBox "Enter a sentence", vbInformation
     Me.Text13.SetFocus
     Exit Sub
End If
 WordCounter (Me.Text13)

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




Vowels and Consonants Counter in Microsoft Access

In this article I would like to share with you a sample program that will ask the user to give a sentence and then our program will count the number of vowels and consonants in given sentence by our user. I am using Microsoft Access 2010 as my programming tool in writing this program.

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.








Sample Program Output



Program Listing

'Count Vowels and Consonants in Microsoft Access
' Written By Mr. Jake R. Pomperada, MAED-IT
' January 5, 2018  Frinday

Option Compare Database

Const vowels = "aeiou"
Const consonants = "bcdfghjklmnpqrstvwxyz"

' This function will count the number of vowels in a given sentence
Private Function CountVowels(strText As String) As Integer
    Dim i As Integer
 Dim asciiToSearchFor As Integer
    For i = 1 To Len(LCase(strText))
        If InStr(1, vowels, Mid$(strText, i, 1), vbTextCompare) Then
            CountVowels = CountVowels + 1
         End If
    Next i
End Function

' This function will count the number of consonants in a given sentence
Private Function CountConsonants(strText As String) As Integer
    Dim i As Integer
 Dim asciiToSearchFor As Integer
    For i = 1 To Len(LCase(strText))
        If InStr(1, consonants, Mid$(strText, i, 1), vbTextCompare) Then
            CountConsonants = CountConsonants + 1
         End If
    Next i
End Function
Private Sub Command16_Click()
Dim vowels_count As Integer
Dim consonants_count As Integer


If Len(Trim(Me.Text13) & vbNullString) = 0 Then
     MsgBox "Enter a sentence", vbInformation
     Me.Text13.SetFocus
     Exit Sub
End If

vowels_count = CountVowels(Me.Text13)
consonants_count = CountConsonants(Me.Text13)

 Me.Label15.Caption = "Total number of consonants is " + Str(vowels_count) + "."
 Me.Label19.Caption = "Total number of vowels is " + Str(consonants_count) + "."

End Sub


Private Sub Command17_Click()
Me.Text13 = ""
Me.Label15.Caption = ""
Me.Label19.Caption = ""
Me.Text13.SetFocus
End Sub

Private Sub Command18_Click()
DoCmd.OpenForm "frmAbout"

End Sub

Private Sub Form_Click()

End Sub





Odd and Even Number Checker in Microsoft Access

A simple program that I wrote using Microsoft Access to ask the user to give a number and then our program will check if the given number is an Odd or Even. The code is very easy to understand and use.  I use Microsoft Access 2010 in writing this program.

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.






Sample Program Output


Program Listing


Option Compare Database

Private Function IsOdd(ByVal oddNumber As Integer) As Boolean
    IsOdd = oddNumber And 1
End Function

Private Sub Command16_Click()
Dim a As Integer


If Len(Trim(Me.Text13) & vbNullString) = 0 Then
     MsgBox "Enter the a Number", vbInformation
     Me.Text13.SetFocus
     Exit Sub
End If

a = Val(Me.Text13)

If IsOdd(a) Then
   Me.Label15.Caption = "The given number " + Str(a) + " is ODD number."
Else
  Me.Label15.Caption = "The given number " + Str(a) + " is EVEN number."
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





Monday, January 1, 2018

Decimal To Roman Numeral in Microsoft Access

A program that I wrote using Microsoft Access to accept a number from your user and then it will convert the given number into it's roman numeral equivalent. I am using Microsoft Access 2000 in writing this application. I hope you will find my work useful.

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 mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.






Sample Program Output


Program Listing

' Written By Mr. Jake R. Pomperada, MAED-IT
' January 1, 2018 Monday
' Microsoft Access 2000

Option Compare Database
Public Function RomanNumeral(ByVal aValue As Long) As String
  Dim i&
  Dim varArabic As Variant, varRoman As Variant
  Dim strResult As String

  varArabic = Array(1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000)
  varRoman = Array("I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M")

  For i = UBound(varArabic) To LBound(varArabic) Step -1
    Do While aValue >= varArabic(i)
      aValue = aValue - varArabic(i)
      strResult = strResult & varRoman(i)
    Loop
  Next i
  RomanNumeral = strResult
End Function

Private Sub Command5_Click()

Dim val_number, display As Double

If Len(Trim(Me.Text2) & vbNullString) = 0 Then
     MsgBox "Enter the a Number", vbInformation
     Me.Text2.SetFocus
     Exit Sub
End If

val_number = RomanNumeral(Me.Text2)

  
 Label8.Caption = "The roman numeral equivalent of " + Trim(Me.Text2) + _
 " is " + Trim(val_number) + "."

End Sub

Private Sub Command6_Click()
Me.Label8.Caption = ""
Me.Text2 = ""
Me.Text2.SetFocus
End Sub

Private Sub Command7_Enter()
  MsgBox ("This program was written by Mr. Jake R. Pomperada")
End Sub