Monday, January 1, 2018

Palindrome in Microsoft Access

In this article I would like to share with you a sample program that will ask the user to give a string or a word and then our program will check and determine if the given word is a Palindrome or Not a Palindrome. I use Microsoft Access 2003 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 Sub Command12_Enter()
Me.txtvalue = ""
Me.Label9.Caption = ""
Me.txtvalue.SetFocus
End Sub
Function IsPalindrome(sInput As String) As Boolean
If sInput = StrReverse(sInput) Then
IsPalindrome = True
Else
IsPalindrome = False
End If
End Function
Private Sub Command13_Click()
Dim Sure As Integer

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

Private Sub Command7_Click()
Dim val_solve As Integer
Dim str_me As String

If Len(Trim(Me.txtvalue) & vbNullString) = 0 Then
     MsgBox "Kindly give a number", vbInformation
     Me.txtvalue.SetFocus
     Exit Sub
End If

Label9.Visible = True
     
        If IsPalindrome(Me.txtvalue) = True Then
            Label9.Caption = "The given word " + UCase(Trim(Me.txtvalue)) + " is a Palindrome."
        Else
           Label9.Caption = "The given word " + UCase(Trim(Me.txtvalue)) + " is Not a Palindrome."
        End If

End Sub







No comments:

Post a Comment