Z
zyus
Is there any way to delete table & query in just one shot. Sort of select all
table/query name and press delete.
Thanks
table/query name and press delete.
Thanks
What exactly do you mean? You can write your own VBA sub to do this.Is there any way to delete table & query in just one shot. Sort of select all
table/query name and press delete.
Copy it into a standard module and use it with extreme care:I use access for reporting purpose. I've created a lot of query & reports. I
want to find a way to delete my queries from query windows by selection and
delete.
hi,
Copy it into a standard module and use it with extreme care:
Public Sub DeleteAllQueries()
Dim db As DAO.Database
Dim qd As DAO.QueryDef
Dim qds() As DAO.QueryDef
Dim Count As Long
Set db = CurrentDb
ReDim qds(db.QueryDefs.Count)
For Count = 0 To db.QueryDefs.Count - 1
Set qds(Count) = db.QueryDefs.Item(Count)
Next Count
For Count = 0 To db.QueryDefs.Count - 1
db.QueryDefs.Delete qds(Count).Name
Next Count
db.QueryDefs.Refresh
Set db = Nothing
End Sub
CoolZyus, do note that this will delete *EVERY QUERY* in your entire database -
not "by selection". Heed Stefan's warning to "use with extreme care" - it's a
tactical nuclear device, not a rifle!