DISPLAY LIST OF TABLES ON IN A FORM

  • Thread starter Thread starter zzzmz
  • Start date Start date
Z

zzzmz

Guest
CAN I DISPLAY A LIST OF ALL TABLES IN MY ACCESS DATABASE ON A FORM?
 
yes you can,
What do you want to do?
1)Just display them? or
2)do you want to open them using the form as well as displaying them?
To do 1) all you have to do is click on label on the toolbox and drag it down to the form and type the names of the table.
to do no.2)
Create macro
Action: OpenTable
Action Argument, Table Name: "Your Table Name"
Save it and In your form create a command button and MISCELLANIOUS, RUN MACRO, select the macro you've created and finish.

hope this helps.
 
Actually as part of my program several users will be exporting tables into an access database. I would like to display all tables in the database to see if all tables have been imported. The list of tables will be constantly changing. Can I diplay this on a form?

Thanks
 
Please don't post the same question under multiple topics.
 
Hiya, I really don't know how you could do that, but I guess you would be able to do it with Visual basic and I have no clue when it comes to visual basic. Sorry but go to this site: www.wopr.com and you could get help from them.
Goodluck.
 
Loop through all the members of the Tabledefs collection. eg:

Public Sub ListTables()

Dim tbl As TableDef

For Each tbl In CurrentDb.TableDefs
Debug.Print tbl.Name
Next

End Sub

this one displays all tables in the debug window, just customize it to your needs.
 
If you only want to display a list of tables in the database, copy and paste this SQL statement into the Row Source of your list box.


SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1) <> "~")
AND (MSysObjects.Type)= 1 ORDER BY MSysObjects.Name;
 

Users who are viewing this thread

Back
Top Bottom