Hiding Tables

Exodus

Registered User.
Local time
Yesterday, 18:20
Joined
Dec 4, 2003
Messages
317
After much searching and reviewing I finally found a way to do this with out using dbHiddenObject. Which is much frowned upon.

This is a sample I use it to relink certain SQL tables at start up. I had to start doing this due to the variables is the way the workstations are set up here. As part of this I set them to Hidden.

Code:
Public Function RefreshTblLink()
Dim tblArray(3) As String
    tblArray(1) = "Some Table 1"
    tblArray(2) = "Some Table 2"
    tblArray(3) = "Some Table 3"
    
    Dim tdf As TableDef
   Dim i As Integer
   For i = 1 To 3
           For Each tdf In CurrentDb.TableDefs
          If tdf.Name = tblArray(i) Then
            tdf.RefreshLink
            'Hide the Tables after relink
           Application.SetHiddenAttribute acTable, tdf.Name, True
              
               Exit For
           End If
      Next
  Next i

End Function
 

Users who are viewing this thread

Back
Top Bottom