Not Monitored
Tag not monitored by Microsoft.
41,603 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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()
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.