hi everyone. i have problem with SQL UPDATE command, with Add and Save Record, Delete Record and Search record, it works well, I have this code:
for SAVE Command button
squery = "": squery = "SELECT * FROM tblEmp WHERE EmpID=" & txtEmpID.Text & ""
Call ExecuteCommand
With rs
.Open squery, conn, adOpenStatic, adLockPessimistic
'.AddNew
.Fields("EmpID") = txtEmpID.Text
.Fields("LName") = txtLast.Text
.Fields("FName") = txtFirst.Text
.Fields("MName") = txtMiddle.Text
.Fields("Pos") = txtPos.Text
.Update
End With
for SEARCH Command Button
squery = "": squery = "SELECT * FROM tblEmp WHERE EmpID=" & txtEmpID.Text & ""
Call ExecuteCommand
With Me
.txtLast = rs!LName
.txtFirst = rs!FName
.txtMiddle = rs!MName
.txtPos = rs!POs
End With
squery = "": squery = "SELECT * FROM tblComp WHERE EmpID=" & txtEmpID.Text & ""
Call ExecuteCommand
With Me
.txtComp = rs!CName
.txtLoc = rs!Loc
End With
but with EDIT/UPDATE command button, how could I use SQL UPDATE statement?
sytax: UPDATE tblName
SET column1=value, column2=value
WHERE somecolumn=somevalue
how could I use this as above SQL (SAVE/SEARCH)..
I have txtboxes, how could i update the records contained in the textboxes displayed by the SEARCH(command button) query?
thanks..