it would be helpful to know what line of the code is highlighted when the error occurs
Also, please use code tags to preserve the indentation of the code highlight the pasted code and click the # button - like this
Code:
Dim db As DAO.Database
Dim rec1 As DAO.Recordset
Dim recFiltered1 As DAO.Recordset
Set db = CurrentDb
Set rec1 = db.OpenRecordset("SELECT [Product Suppliers Name].[Product ID], [Product Suppliers Name].[Supplier] FROM [Product Suppliers Name];", dbOpenDynaset, dbSeeChanges)
rec1.Filter = "[Product ID] = " & Me.ID
Set recFiltered1 = rec1.OpenRecordset
If (Not (recFiltered1.EOF)) Then
rec1.Edit
rec1![Supplier] = supplierNameSavedinProductSupplierNametable
rec1.Update
Else
rec1.AddNew
rec1![Product ID] = Me.ID
rec1![Supplier] = supplierNameSavedinProductSupplierNametable
rec1.Update
End If
supplierNameSavedinProductSupplierNametable = ""
Set rec1 = Nothing
Set recFiltered1 = Nothing
Set db = Nothing