I try to write a query in my Access Project but this runtime error occures in the line, where SQL query is. This is my code:
Private Sub Befehl80_Click()
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT tb_KonzeptDaten.DFCC, tb_KonzeptDaten.OBD_Code AS Konzept_Obd,tb_KonzeptDaten.DFC INTO Test_Table FROM tb_KonzeptDaten", dbOpenDynaset)
Me.txtDs = rst.RecordCount
End Sub
Would you please tell me how can I solve this problem and why this error occures?
The sql is an action query, it creates a table. You cannot open a recordset from an action query. If you want to run the action query, you can say: