Search Button error

Francis Mkango 1 Reputation point
2020-06-12T21:41:22.863+00:00

This is the entire code that am using in vb 2012 ultimate for the search button
Call FrancisDB()

    If txtsearch.Text = "" Then
        MsgBox("PLEASE INSERT EMPLOYEE ID", vbCritical + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
    Else
        Dim SearchNumber As Integer = Me.txtsearch.Text
        rs.Open("Select * From [employees] Where Employee ID=" & SearchNumber & "'", con, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockPessimistic, -1)
        If rs.RecordCount = 0 Then
            MsgBox("RECORD DOES NOT EXIT", vbCritical + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
            rs.Close()

        Else
            txtAddress.Text = rs("Address").Value
            txtContactno.Text = rs("Contact No").Value
            txtDcontract.Text = rs("Duration of Contract").Value
            txtEid.Text = rs("Employee ID").Value
            txtDepartment.Text = rs("Department").Value
            txtFname.Text = rs("Full Name").Value
            txtnrc.Text = rs("NRC").Value
            txtNumChildren.Text = rs("Number of Children").Value
            txtPosition.Text = rs("Position").Value
            cmbgender.Text = rs("Gender").Value
            cmbmstatus.Text = rs("Marital Status").Value
            cmbtcontract.Text = rs("Type of Contract").Value
            dtpDbirth.Text = rs("Date of Birth").Value
            dtpDemployment.Text = rs("Date of Employment").Value
            dtpEcontract.Text = rs("End of Contract").Value
            MsgBox("RECORD FOUND", vbInformation + vbOKOnly, "ST PETER'S ANGLICAN PARISH")
            rs.Close()

        End If
    End If
    con.Close()
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,947 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP
    2020-06-12T22:58:37.213+00:00

    Visual basic is not currently supported here on QnA. They're actively answering question in dedicated forums here.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral

    --please don't forget to Accept as answer if the reply is helpful--


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    0 comments No comments