troubleshooting Question

Remove hidden table and query names from combo boxes.

Avatar of IZIKILL2
IZIKILL2 asked on
Microsoft Access
4 Comments2 Solutions340 ViewsLast Modified:
Have the below function that populates a combo box with query and table names.

Would like to adjust the code to have those tables and queries that are hidden be exempt from the list.

Private Sub Form_Load()
'updated me.objcombo with table names'
   Dim tblNames As String
   tblNames = ""
   Dim tbl As AccessObject
   For Each tbl In CurrentData.AllTables
    If Not Left(tbl.Name, 4) = "Msys" Then
    tblNames = tblNames + Chr(34) + tbl.Name + Chr(34) + ";"
    End If
   Next tbl
   Dim qry As AccessObject
   For Each qry In CurrentData.AllQueries
    tblNames = tblNames + Chr(34) + qry.Name + Chr(34) + ";"
   Next qry
   Me!objcombo.RowSourceType = "Value List"
   Me!objcombo.RowSource = tblNames

End Sub
Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros