Unanswered: Runtime Error 3197- record changed by other user, please help
I have tried various suggestions related to this problem on the messageboards but can't seem to fix it. Keep getting error that records are being accessed at the same time I am deleting but it is a single user application with one form I am currently on and nobody else is changing records. Below is my code, any suggestion appreciated.
Private Sub cmdDelete_Click()
Dim strMsg As String
Dim rst As ADODB.Recordset
Dim obj_connect As ADODB.Connection
Dim obj_command As ADODB.Command
Dim strCon As String
Dim strsql As String
Dim strSerial As String
Dim strTcpip As Variant
Set obj_connect = New ADODB.Connection
Set obj_command = New ADODB.Command
Set rst = New ADODB.Recordset
strCon = GetConnectionString()
obj_command.CommandType = adCmdText
strTcpip = Me.TCP_IP_Address.Value
strSerial = Me.RecordID.Value
If (IsNull(strTcpip)) Or (strTcpip = "") Then
Response = MsgBox("Do You Want To Delete This Printer From Inventory?", vbYesNo + vbInformation, "Warning")
If Response = vbYes Then
strsql = "DELETE FROM [Network and Local Printers] WHERE RecordID='" & strSerial & "'"
Response = MsgBox("This Printer Has A TCP/IP Address, Please Contact The Network Printers Administrator For Deletion?", vbOKOnly + vbCritical, "Cannot Delete Printer")
sorry about post, managed to fix this issue.. didn't realize records weren't being updated on the changed event of text boxes which would obviously screw up entries and make the form data different from the database, whoops!