Question filter search of table objects (1 Viewer)

genesis

Registered User.
Local time
Today, 11:18
Joined
Jun 11, 2009
Messages
205
Private Sub Command0_Click()
Dim obj As AccessObject, dbs As Object

Set dbs = Application.CurrentData

' Check each object of the AllTables collection
For Each obj In dbs.AllTables
' When you find a table, display its name
MsgBox obj.Name
Next obj

End Sub


--------------------------------------

the result of the above code searches for all table objects including the hidden and system tables.

How can I modify this code that it will not search the system table objects?

Kindly help.
 

genesis

Registered User.
Local time
Today, 11:18
Joined
Jun 11, 2009
Messages
205
Dim db As Database

Dim Tbl As TableDef
Dim TblNames As String
Dim TblCount As Integer
Set db = CurrentDb

TblCount = 0

For Each Tbl In db.TableDefs
If Tbl.Attributes = 0 Then 'Ignores System Tables
TblNames = Tbl.Name

MsgBox TblNames
End If
Next Tbl


----------------------------------------------------------

I modified base on my research. and its working now.
 

Users who are viewing this thread

Top Bottom