This is the beginning part of the code. Where the "For Each tdf.." is, I want to change it optionally to "For Each qdf...."
I haven't used classes before! Will need to read up about them.
Code:
ObjType(1) = "Query"
ObjType(2) = "Form"
ObjType(3) = "Report"
ObjType(4) = "Macro"
ObjType(5) = "Module"
DoCmd.SetWarnings False
Set app = New Access.Application
app.OpenCurrentDatabase Me!DBName
Set dbs = app.CurrentDb 'open other database
Set rst = CurrentDb.OpenRecordset("WhereUsed_tbl")
DoCmd.RunSQL "DELETE * FROM WhereUsed_tbl;"
Me!TblTotal = dbs.TableDefs.Count 'get count of tables
Me!TblProc = 0
For Each tdf In dbs.TableDefs
UpdOpt = False
If Not IsNull(Me!txtObjName) And Me!txtObjName <> "" Then 'if only one table selected
TableN = Me!txtObjName
Else
TableN = tdf.Name
End If
Me!TblProc = Me!TblProc + 1
For x = 1 To 5