Results 1 to 6 of 6
  1. #1
    stigmatized is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2009
    Location
    Riyadh, Saudi Arabia
    Posts
    17

    declare an array containing the names of all existing tables

    hi guys,



    Please help me on my task with combo box list. I have 36 existing tables in my database. I don't know the code to get the table names so that I can use them in an array which will be put in the combo box list.

    I hope that this is possible to have a VBA code.

    Thanks in advance!!!

    stigmatized

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Why do you have to put the table names into an array in order to put them in a combo?

    You could use this as Rowsource of the combo
    Code:
    SELECT Name
     FROM MSysObjects 
     WHERE Name not Like '~*'  AND [Name] not Like 'MSys*'  AND MsysObjects.Type=1

  3. #3
    stigmatized is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2009
    Location
    Riyadh, Saudi Arabia
    Posts
    17
    Quote Originally Posted by June7 View Post
    Bing: Access VBA list tables in database

    http://www.consultdmw.com/access-VBA-list-objects.htm

    thank you very much. problem solved!!

  4. #4
    stigmatized is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2009
    Location
    Riyadh, Saudi Arabia
    Posts
    17
    Quote Originally Posted by orange View Post
    Why do you have to put the table names into an array in order to put them in a combo?

    You could use this as Rowsource of the combo
    Code:
    SELECT Name
     FROM MSysObjects 
     WHERE Name not Like '~*'  AND [Name] not Like 'MSys*'  AND MsysObjects.Type=1

    it works! this answer my query about the combo list values.

    thanks a lot!!

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Out of curiosity, why are you doing this? Comboboxes are generally used to facilitate the access of things by end users, and end users should never have direct access to Tables, but rather should access data through Queries or Forms.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    stigmatized is offline Novice
    Windows 8 Access 2007
    Join Date
    Sep 2009
    Location
    Riyadh, Saudi Arabia
    Posts
    17
    this combobox list will serve as the selection to be used in importing data from excel and append to the selected table.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 02-10-2014, 07:43 AM
  2. Link existing names in Access DB to Outlook contact
    By mikejoka in forum Import/Export Data
    Replies: 1
    Last Post: 08-30-2013, 12:24 PM
  3. Field names in an array
    By Seamus59 in forum Programming
    Replies: 11
    Last Post: 08-09-2013, 11:56 AM
  4. Replies: 6
    Last Post: 05-31-2013, 07:46 PM
  5. Finding similar names between two tables.
    By Laurie B. in forum Access
    Replies: 1
    Last Post: 07-15-2011, 03:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums