hiding tables....

J

Jeff Boyce

How determined/informed/curious are your users?

.... and why?

You've asked a "how" question, but not explain what business need you hope
to solve ...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

kc-mass

Hi,

Try these routines to hide and unhide your tables:

Sub HideAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= dbHiddenObject
End If
Next lngTable
End Sub


Sub ShowAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= 0
End If
Next lngTable
End Sub

Regards

Kevin
 
A

ambushsinger

This worked great...Thanks for taking the time.

kc-mass said:
Hi,

Try these routines to hide and unhide your tables:

Sub HideAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= dbHiddenObject
End If
Next lngTable
End Sub


Sub ShowAllTables()
Dim lngTable As Long
Dim db As Database
Set db = CurrentDb
For lngTable = 0 To db.TableDefs.Count - 1
'Do nothing if temporary or system table
If Left(db.TableDefs(lngTable).Name, 1) = "~" Or _
Left(db.TableDefs(lngTable).Name, 4) = "MSYS" Then
Else
Application.CurrentDb.TableDefs(lngTable).Properties("Attributes").Value
= 0
End If
Next lngTable
End Sub

Regards

Kevin






.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top