I am using a MS Access DB that is running on a SQL server. I need to debug this database that was created by another person. When trying to add a record from a form I recieve the following error:

Run time error 3155
ODBC insert on a linked table <name> failed


What are the the usual causes for this error? And what are a few steps that I could take to solve this problem?

Below is the VBA code if it is helpful the error occurs after 'rs.update'




Option Compare Database
Option Explicit


Private Sub cboCustomer_Click()
If Me.cboCustomer.Value = 0 Then
DoCmd.OpenForm ("UNIXfrmNewCustomer")
End If
End Sub

Private Sub cmdAdd_Click()
Dim db As Database
Dim rs As Recordset
Dim rs2 As Recordset
Dim rs3 As Recordset
Dim rs4 As Recordset
Dim rs5 As Recordset
Dim rs6 As Recordset
Dim strSQL As String
Dim strDNSQL As String
Dim strIPSQL As String

Set db = CurrentDb
Set rs = db.OpenRecordset("tblDeviceInventory")



Set rs2 = db.OpenRecordset("tblIPAddresses")
Set rs3 = db.OpenRecordset("tblServiceContract")

'------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------------------------
'Validate device name
strDNSQL = "SELECT tblDeviceInventory.DeviceName FROM tblDeviceInventory " & _
"WHERE tblDeviceInventory.DeviceName = '" & Me.txtDeviceName & "';"

Set rs5 = db.OpenRecordset(strDNSQL, dbOpenDynaset)

'check for null and duplicate host names
If Not IsNull(Me.txtDeviceName) Then
If rs5.RecordCount = 0 Then
'do nothing
Else
MsgBox "Host Name already exists", vbExclamation, "Duplicate Host Name"
Me.txtDeviceName.SetFocus
Exit Sub
End If
Else
MsgBox "Please enter a host name before continuing", vbExclamation, "Null Host Name"
Me.txtDeviceName.SetFocus
Exit Sub
End If
rs5.Close

'--------------------------------------------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------------------------------------------
strIPSQL = "SELECT tblIPAddresses.IPAddress FROM tblIPAddresses WHERE tblIPAddresses.IPAddress = '" & Me.txtPrimaryIP & "';"

Set rs6 = db.OpenRecordset(strIPSQL, dbOpenDynaset)

If Not IsNull(Me.txtPrimaryIP) Then
If rs6.RecordCount = 0 Then
'do nothing
Else
MsgBox "IP Address already exists with another host name", vbExclamation, "Duplicate IP Address"
Me.txtPrimaryIP.SetFocus
Exit Sub
End If
Else
MsgBox "Please enter a primary IP address", vbExclamation, "Null Primary IP"
Me.txtPrimaryIP.SetFocus
Exit Sub
End If

rs6.Close
'-----------------------------------------------------------------------------------------------------------------------------
'-----------------------------------------------------------------------------------------------------------------------------

'Add records to tblDeviceInventory
rs.AddNew
rs!DeviceName = Me.txtDeviceName
rs!HostID = Me.txtHostID
rs!DNSName = Me.txtDNS
rs!ServerType = Me.cboServerType
rs!OS = Me.cboOS
rs!RTypeNumber = Me.cboRAID
rs!Model = Me.cboModel
rs!Processors = Me.txtProcessors
rs!Memory = Me.txtMemory
rs!NumberSystemBoards = Me.txtSystemBoards
rs!EMCStorageSpace = Me.txtEMC
'rs!MCC = Me.cboCustomer
'rs!VendorID = Me.cboVendor
'rs!ContractNumber = Me.txtContractNumber
rs.Update

'Add records to tblIPAddresses
rs2.AddNew
rs2!IPAddress = Me.txtPrimaryIP
rs2!DeviceName = Me.txtDeviceName
rs2!PrimaryIP = True
rs2!DeviceType = Me.cboDeviceType
rs2.Update



'Add record to tblCustomer/Device
Set rs4 = db.OpenRecordset("tblCustomer/Device")
rs4.AddNew
rs4!DeviceName = Me.txtDeviceName
rs4!MCC = Me.cboCustomer
rs4!AppCode = Me.cboBillingApplication
rs4.Update

MsgBox "Add additional information about server in edit mode", vbInformation, "Additional Info"
DoCmd.Close acForm, "UNIXfrmAddServer"
rs.Close
rs2.Close
rs3.Close
End Sub

Private Sub cmdCancel_Click()
MsgBox "No server information has been saved", vbInformation, "Cancel"
DoCmd.Close acForm, "UNIXfrmAddServer"
End Sub

Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
End Sub

Private Sub txtDeviceName_LostFocus()
Dim db As Database
Dim rs As Recordset
Dim strSQL As String

Set db = CurrentDb

strSQL = "SELECT tblDeviceInventory.DeviceName FROM tblDeviceInventory " & _
"WHERE tblDeviceInventory.DeviceName = '" & Me.txtDeviceName & "';"

Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)

'check for null and duplicate host names
If Not IsNull(Me.txtDeviceName) Then
If rs.RecordCount = 0 Then
'do nothing
Else
MsgBox "Host Name already exists", vbExclamation, "Duplicate Host Name"
Exit Sub
End If
End If

rs.Close
End Sub

Private Sub txtPrimaryIP_LostFocus()
Dim db As Database
Dim rs As Recordset
Dim strSQL As String

Set db = CurrentDb

strSQL = "SELECT tblIPAddresses.IPAddress FROM tblIPAddresses WHERE tblIPAddresses.IPAddress = '" & Me.txtPrimaryIP & "';"

Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)

If Not IsNull(Me.txtPrimaryIP) Then
If rs.RecordCount = 0 Then
'do nothing
Else
MsgBox "IP Address already exists with another host name", vbExclamation, "Duplicate IP Address"
Exit Sub
End If
Else
MsgBox "Please enter a primary IP address", vbExclamation, "Null Primary IP"
Exit Sub
End If

rs.Close
End Sub

Private Sub txtSystemBoards_LostFocus()

'check for numeric value if not null
If Not IsNull(Me.txtSystemBoards) Then
If Not IsNumeric(Me.txtSystemBoards) Then
MsgBox "Please enter an integer value", vbExclamation, "Non Integer Entry"
Me.txtEMC.SetFocus
Me.txtSystemBoards.SetFocus
Exit Sub
End If
End If

End Sub