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[CODE]
Hi Guys, can someone please advise what is wrong with my code. I encounter run time errror 3027. Thank you.