Hello,
I could use a little help trying to figure this one out--I would greatly appreciate it.
I'm using an UPDATE statement in VBA to update a table. Typically, this statement should only affect one record. For some reason, it's updating all the records in the table. I'm assuming my WHERE statement is wrong. Here's a short version of the code (all variables in the SQL string are integers:
I could use a little help trying to figure this one out--I would greatly appreciate it.
I'm using an UPDATE statement in VBA to update a table. Typically, this statement should only affect one record. For some reason, it's updating all the records in the table. I'm assuming my WHERE statement is wrong. Here's a short version of the code (all variables in the SQL string are integers:
Code:
Set cn = New ADODB.Connection Set rs = New ADODB.Recordset Dim recint As Integer strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbLocation cn.Open strConnection strSQL = "UPDATE tblTest SET Permission ='" & Permission & "', Order1 ='" & Order1 & "' WHERE CustID = RecID" cn.Execute strSQL cn.Close Set cn = Nothing Set rs = Nothing
Comment