W
WANNABE
I was given this code that would delete Queries starting with ~. And I thought
maybe I would be able to use it to delete 200 reports, but I obviously do not
understand this well enough, would someone please provide me some insight??
I looked at the MSysObjects table and figured that since all Reports are of TYPE
= -32764 maybe I could change this line
If VBA.InStr(Qdef.Name, "~") = 1 Then
to
If VBA.InStr(Qdef.TYPE, -32764) = 1 Then
I have discovered that Qdef.name does not represent the fieldname NAME ???????
Thank you to anyone who helps..
This is what I started with>>
Public Sub SQ1()
Dim Db As DAO.Database
Dim Qdef As DAO.QueryDef
Dim i As Integer
Set Db = Access.CurrentDb
For i = Db.QueryDefs.Count - 1 To 0 Step -1
Set Qdef = Db.QueryDefs(i)
If VBA.InStr(Qdef.Name, "~") = 1 Then
Access.DoCmd.DeleteObject Access.AcObjectType.acQuery, Qdef.Name
End If
Set Qdef = Nothing
Next
Set Db = Nothing
End Sub
maybe I would be able to use it to delete 200 reports, but I obviously do not
understand this well enough, would someone please provide me some insight??
I looked at the MSysObjects table and figured that since all Reports are of TYPE
= -32764 maybe I could change this line
If VBA.InStr(Qdef.Name, "~") = 1 Then
to
If VBA.InStr(Qdef.TYPE, -32764) = 1 Then
I have discovered that Qdef.name does not represent the fieldname NAME ???????
Thank you to anyone who helps..
This is what I started with>>
Public Sub SQ1()
Dim Db As DAO.Database
Dim Qdef As DAO.QueryDef
Dim i As Integer
Set Db = Access.CurrentDb
For i = Db.QueryDefs.Count - 1 To 0 Step -1
Set Qdef = Db.QueryDefs(i)
If VBA.InStr(Qdef.Name, "~") = 1 Then
Access.DoCmd.DeleteObject Access.AcObjectType.acQuery, Qdef.Name
End If
Set Qdef = Nothing
Next
Set Db = Nothing
End Sub