Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hidden Objects (Access 2000)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Objects (Access 2000)

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

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Objects (Access 2000)

    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

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hidden Objects (Access 2000)

    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.
    Francois

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Hidden Objects (Access 2000)

    Just use

    Application.SetOption "Show Hidden Objects", False

    instead of

    Application.SetOption "Show Hidden Objects", f

Posting Permissions

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