Hello,
I have the following piece of code that inserts records into a table using recordsets. It works fine, but i want it to check if the combination of field "Question Number" and "App ID" already exists in my table, and if it does, then skip the row and continue with next one.
Set rst = dbs.OpenRecordset("SetAnswers")
RecCount = 0
For Each i In Combo6.ItemsSelected
rst.AddNew
rst![Question Number] = Combo6.ItemData(i)
rst![App ID] = Forms!RiskAssesment.[ID]
rst.Update
RecCount = RecCount + 1
Next i
Hope this is not completely stupid question. Thanks for any help.
I have the following piece of code that inserts records into a table using recordsets. It works fine, but i want it to check if the combination of field "Question Number" and "App ID" already exists in my table, and if it does, then skip the row and continue with next one.
Set rst = dbs.OpenRecordset("SetAnswers")
RecCount = 0
For Each i In Combo6.ItemsSelected
rst.AddNew
rst![Question Number] = Combo6.ItemData(i)
rst![App ID] = Forms!RiskAssesment.[ID]
rst.Update
RecCount = RecCount + 1
Next i
Hope this is not completely stupid question. Thanks for any help.