• Hidden Objects (Access 2000)

    Author
    Topic
    #422446

    In the command bar Tools- Options there is a field Hidden Objects.Is it possible to set this field to False by code?
    I have a function that hides the tables.It is an excellent function made by Hans from the same Forum.Can i also set the field Hidden Objects to false in the same code ?

    Public Sub HideTables(f As Boolean)
    ‘To hide tables, use HideTables True
    ‘and to unhide them, use HideTables False
    Dim tbl As AccessObject
    For Each tbl In CurrentData.AllTables
    If Not Left(tbl.Name, 4) = “MSys” Then
    Application.SetHiddenAttribute acTable, tbl.Name, f
    End If
    Next tbl
    Set tbl = Nothing
    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #963522

      To change the option, you can use :
      Application.SetOption “Show Hidden Objects”, False
      or
      Application.SetOption “Show Hidden Objects”, True

      • #963528

        Thank you so much for your advice.I applied it and it did work. Whwn i tried to intergate it in my coe however,i coldnt change the option.
        What may be the reason for that?
        Public Sub HideTables(f As Boolean)
        ‘To hide tables, use ‘and to unhide them, use HideTables False
        Dim tbl As AccessObject
        For Each tbl In CurrentData.AllTables
        If Not Left(tbl.Name, 4) = “MSys” Then
        Application.SetHiddenAttribute acTable, tbl.Name, f
        End If
        Next tbl
        Set tbl = Nothing
        Application.SetOption “Show Hidden Objects”, f
        End Sub

        • #963530

          What are you trying to do ?
          If you use your function with false, you unhide each table individually and then set the option to NOT show the hidden tables (and there are no more).
          If you use your function with True, you hide each table individually and then set the option to show the hidden tables (and there are all).
          I don’t understand the logic.

        • #963531

          Just use

          Application.SetOption “Show Hidden Objects”, False

          instead of

          Application.SetOption “Show Hidden Objects”, f

    Viewing 0 reply threads
    Reply To: Hidden Objects (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: