I have no errors with this simple code, but it doesn't write the updated field values to the table.
What am I overlooking? I'm moving everything in this project from DAO to ADO, this is my first save edited record procedure.
Code:
Dim iSQLStr As String
Dim rsCon As ADODB.Recordset
Set cnCon = New ADODB.Connection
Set rsCon = New ADODB.Recordset
cnCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & GetDataPath
cnCon.Open
iSQLStr = "SELECT * FROM tblData WHERE patID = '" & cmbID.Text & "' & AND Num = '" & cmbpatNum.Text & "'"
rsCon.Open iSQLStr, cnCon, adOpenStatic, adLockOptimistic, adCmdText
rsCon.Fields("Group").Value = cmbGroup.Text
rsCon.Fields("Label").Value = txtLabel.Text
rsCon.Fields("Floor").Value = cmbFloor.Text
rsCon.Fields("Wing").Value = cmbWing.Text
rsCon.Fields("Mess").Value = cmbMess.Text
rsCon.Fields("Trans").Value = cmbTrans.Text
rsCon.Update
MsgBox "Record Successfully updated", vbInformation
cnCon.Close
Any guidance appreciated.