Hi all
Sorry- The title was wrong, My problem is when I type a the ID number in the text box for updating the record, it gives me an error "Data type mismatch in criteria expression."
Could anyone help me please in solving this problem?
This is my update code.
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HRIS.mdb;")
cn.Open()
Dim strupdate As String
strupdate = "update Employees set [Name] ='" & txtName.Text & "',Mobile ='" & txtMob.Text & "',Home_Phn ='" & txtHomePhn.Text & "',Date_Birth ='" & txtAge.Text & "',CPR='" & txtCPR.Text & _
"', Address='" & txtAdd.Text & "',email='" & txtEmail.Text & "',Date_hiring='" & txtWorkDate.Text & "',Department='" & txtDep.Text & "',basic_salary='" & txtSal.Text & "'where ID='" & txtSearch.Text & "'"
cmd = New OleDbCommand(strupdate, cn)
cmd.ExecuteNonQuery()
cn.Close()
Thanks in Advance :)