show only unhidden access forms in combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TrevoriousD
    New Member
    • May 2010
    • 5

    show only unhidden access forms in combo box

    Hi

    I want to list my unhidden access forms, reports, in a combo box. this is the piece of code i already use and it works great but it also shows me the hidden objects. I don't know how to exclude the hidden objects.

    Code:
    Private Sub Form_Load()
        Call GetList
    End Sub
    Code:
    Public Sub GetList()
        Dim Item As AccessObject
    
        For Each Item In CurrentProject.AllForms
            DBItem.RowSourceType = "Value List"
            DBItem.AddItem Item.Name
        Next
    End Sub
    Please help.
    Last edited by Jim Doherty; May 24 '10, 03:55 PM. Reason: Code tags
  • Jim Doherty
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    Originally posted by TrevoriousD
    Hi

    I want to list my unhidden access forms, reports, in a combo box. this is the piece of code i already use and it works great but it also shows me the hidden objects. I don't know how to exclude the hidden objects.

    Private Sub Form_Load()
    Call GetList
    End Sub


    Public Sub GetList()
    Dim Item As AccessObject

    For Each Item In CurrentProject. AllForms
    DBItem.RowSourc eType = "Value List"
    DBItem.AddItem Item.Name
    Next
    End Sub

    Please help.
    Welcome to Bytes :-)

    Code:
    For Each Item In CurrentProject.AllForms
    If Application.GetHiddenAttribute(Item.Type, Item.Name) = False Then
    '......do your logic code here
    End if
    Next

    Comment

    • TrevoriousD
      New Member
      • May 2010
      • 5

      #3
      BRILLIANT!!!!!! It works. Thanks so much for the help.

      trevoriousd

      Comment

      • Jim Doherty
        Recognized Expert Contributor
        • Aug 2007
        • 897

        #4
        Originally posted by TrevoriousD
        BRILLIANT!!!!!! It works. Thanks so much for the help.

        trevoriousd
        You are welcome :-)

        Comment

        Working...