hi all, i wrote a code for delete all records of a query on run program ,but it doesn't work, which part of this code is inaccurate?? can anyone correct it ?
Public Function del()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("qry_Students")
Set rst = qdf.OpenRecordset()
rst.Fields.Delete
rst.Close
Set rst = Nothing
Set qdf = Nothing
Set db = Nothing
End Function
Thanks in Advanced.