Public Class txtForm click here—>>>
Before using the code u should change the function, simply click this ” step 1 “ in order to done it well..!!!
The color Blue states that u have change the function from CLICK to KEYPRESS
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtalpha.KeyPress
If IsNumeric(e.KeyChar) Then
e.KeyChar = “”
End If
End Sub
Private Sub txtnumber_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtnumber.KeyPress
If Asc(e.KeyChar) <= 32 Or _
(Asc(e.KeyChar) >= Asc(”0″) And Asc(e.KeyChar) <= Asc(”9″)) Then
Else
e.KeyChar = “”
End If
End Sub
this is the crystal report for visual basic also known as the paper lay-out/output of the program
Public Class FindForm click here—>>>
Private Sub FindForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
‘TODO: This line of code loads data into the ‘RECORDSDataSet1.BIRTH’ table. You can move, or remove it, as needed.
Me.BIRTHTableAdapter.Fill(Me.RECORDSDataSet1.BIRTH)
End Sub
Private Sub Btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnclose.Click
Me.Dispose()
End Sub
Private Sub Btnselect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnselect.Click
Form2.fID = Me.DataGridView1.Item(0, Me.DataGridView1.CurrentRow.Index).FormattedValue
Me.Dispose()
End Sub
Private Sub Btnretry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btnretry.Click
Me.Txtfind.Text = “”
Me.bindfind.Filter = “LASTNAME LIKE ‘” & Me.Txtfind.Text & “%’ OR FIRSTNAME LIKE ‘” & Me.Txtfind.Text & “%’ “
Me.Btnselect.Enabled = True
Me.Btnretry.Enabled = False
Me.Txtfind.Enabled = True
Me.DataGridView1.Refresh()
Me.DataGridView1.CancelEdit()
Me.BIRTHTableAdapter.Fill(Me.RECORDSDataSet1.BIRTH)
End Sub
Private Sub Txtfind_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txtfind.TextChanged
Me.bindfind.Filter = “LASTNAME LIKE ‘” & Me.Txtfind.Text & “%’ OR FIRSTNAME LIKE ‘” & Me.Txtfind.Text & “%’ OR MI LIKE ‘” & Me.Txtfind.Text & “%’”
Me.Btnretry.Enabled = True
End Sub
End Class
Public Class PasswordForm
Public nCounter As Integer click this —->>>
” This color RED text used to count the wrong access/input by the user. If he/she input more than 3 times, the program will automatically close ”
Private Sub btnpassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
” The VIOLET text used to access your database/Microsoft Access
Dim oRow As DataRow
If Me.txtuser.Text = “” Then
MsgBox(”Please Encode the User!”, MsgBoxStyle.Critical, “CONFIRM USER”)
Me.lbldisply.Text = “Empty User!!!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
ElseIf Me.txtpassword.Text = “” Then
MsgBox(”Please Encode the Password!”, MsgBoxStyle.Critical, “CONFIRM PASSWORD”)
Me.lbldisply.Text = “Empty Password!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
Else
For Each oRow In Me.RECORDSDataSet.PASS
If (oRow.Item(”userid”) = Me.txtuser.Text) Then
If (oRow.Item(”password”) = Me.txtpassword.Text) Then
Form1.bAccess = True
End If
End If
Next
If Form1.bAccess = True Then
Me.Close()
End If
Else
MsgBox(”Incorrect User or Password”, MsgBoxStyle.Critical, “Access Denied!!!”)
Me.lbldisplay.Text = “Access Denied!”
nCounter = nCounter + 1
If nCounter = 3 Then
Me.Close()
End If
End If
End If
End Sub
End Class