You could do this in vba code using the TableDef collection like below (probably wouldn't want to do it with a message box though, but...for simplicity's sake...) Or you could just directly query the MSysObjects table (name & type). Each different object type will have a different type value. Be careful that you don't accidentally update the MSysObjects table or you'll cause problems.
Dim dbs As Database Dim tdf As TableDef
Set dbs = CurrentDb dbs.TableDefs.Refresh With dbs For Each tdf In dbs.TableDefs MsgBox (tdf.Name) Next tdf .Close End With End Sub
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.