Call Open_conn
If BEdt = False Then
Rs.Open "Select * from tblpayroll where EmployeeID='" + Trim(txtEmpID.Text) + " '", Cn
If Rs.EOF = False Then
MsgBox "Duplicate Employee ID", vbInformation, "Duplicate"
Else
Cn.Execute "Insert into tblpayroll values('" + Trim(txtEmpID.Text) + "', '" _
+ Trim(txtfullname.Text) + "','" + Trim(cbogender.Text) + "','" _
+ Trim(cbostatus.Text) + "','" + Trim(txtposition.Text) + "')'" _
+ Trim(txtBs.Text) + "','" + Trim(cboEStatus.Text) + "','" _
+ Trim(txtAdd.Text) + "','" + Trim(txtContact.Text) + "','" _
+ Trim(txtSSS.Text) + "','" + Trim(txtTin.Text) + "','" _
+ Trim(txtphil.Text) + "')"";"
MsgBox "New Record Saved!", vbInformation, "Employee Info"
End If

Close_Conn

end sub

what should i do?
tnx in advance....

Exactly what the title says...

Look closely at line 3.

Rs.Open "Select * from tblpayroll where EmployeeID= '"+ Trim(txtEmpID.Text) +"' ", Cn

Call Open_conn
If BEdt = False Then
Rs.Open "Select * from tblpayroll where EmployeeID='" + Trim(txtEmpID.Text) + " '", Cn
If Rs.EOF = False Then
MsgBox "Duplicate Employee ID", vbInformation, "Duplicate"
Else
Cn.Execute "Insert into tblpayroll values('" + Trim(txtEmpID.Text) + "', '" _
+ Trim(txtfullname.Text) + "','" + Trim(cbogender.Text) + "','" _
+ Trim(cbostatus.Text) + "','" + Trim(txtposition.Text) + "')'" _
+ Trim(txtBs.Text) + "','" + Trim(cboEStatus.Text) + "','" _
+ Trim(txtAdd.Text) + "','" + Trim(txtContact.Text) + "','" _

  • Trim(txtSSS.Text) + "','" + Trim(txtTin.Text) + **"*';"****Bold Text Here
  • _" we get just change lightly and see
    MsgBox "New Record Saved!", vbInformation, "Employee Info"
    End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.