Results 1 to 2 of 2

Thread: hiding tables

  1. #1
    Join Date
    Jun 2011

    Unanswered: hiding tables

    i split my database but frontend still have tables which i dont want my user to view. I hide those tables before deploying the frontend but my question is anyone can easily unhide those tables in navigation pane settings. is their any other way to hide the tables or remove them from frontend.

  2. #2
    Join Date
    Oct 2003
    I don't know a way of restricting access to the tables directly, but if you build the navigation in your database up in such a way that you don't need to display the navigation window, I do have a method of blocking access.

    Be very careful with it though because it's possible to lock yourself out of design mode totally. Play around on a dummy db to get used to it.

    I have a module called ByPass which contains the following code;

    Public Function SetBypassPropertyTrue()
        Const DB_Boolean As Long = 1
        ChangeProperty "AllowBypassKey", DB_Boolean, True
    End Function
    Public Function SetBypassPropertyFalse()
        Const DB_Boolean As Long = 1
        ChangeProperty "AllowBypassKey", DB_Boolean, False
    End Function
    Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
        Dim dbs As Object, prp As Variant
        Const conPropNotFoundError = 3270
        Set dbs = CurrentDb
        On Error GoTo Change_Err
        dbs.Properties(strPropName) = varPropValue
        ChangeProperty = True
        Exit Function
        If Err = conPropNotFoundError Then  ' Property not found.
            Set prp = dbs.CreateProperty(strPropName, _
                varPropType, varPropValue)
            dbs.Properties.Append prp
            Resume Next
            ' Unknown error.
            ChangeProperty = False
            Resume Change_Exit
        End If
    End Function
    Now you will need somewhere where you can switch the database bypass on and off. Place this behind a button somewhere in your DB (ideally on the startup window).

            If InputBox(vbCrLf _
            & "The ByPass function enables you to open this database in the design view." & vbCrLf _
            & "To enable this, please enter the ByPass password", "ByPass") = "PASSWORD" Then
                Call SetBypassPropertyTrue
                MsgBox "The ByPass key has been enabled" & vbCrLf _
                & "Please now exit the system and re-open it whilst holding the SHIFT key", vbInformation, "ByPass"
                Call SetBypassPropertyFalse
                MsgBox "Password incorrect; The ByPass key has been disabled", vbCritical, "ByPass"
            End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts