Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Chip, Thanks for the code, but my problem still persists. The tables listed above still appear in addition to the tables created by me. What do I do? Peace, Shivboy Chip Pearson Wrote: Try code like the following. Set a reference to DAO 3.6 and run the following code: Sub AAA() Dim DB As DAO.Database Dim Tbl As DAO.TableDef Dim Rng As Range Dim Fld As DAO.Field Set Rng = Range("A1") Set DB = DAO.OpenDatabase("H:\Test\Test.mdb")'<<< CHANGE For Each Tbl In DB.TableDefs If Tbl.Attributes = 0 Then Rng.Value = Tbl.Name Set Rng = Rng(2, 2) For Each Fld In Tbl.Fields Rng.Value = Fld.Name Set Rng = Rng(2, 1) Next Fld Set Rng = Rng(1, 0) End If Next Tbl DB.Close End Sub "shivboy" wrote in message ... I am using VBA in MS Excel to create tables in MS Access and set relationships between the tables as I have large amounts of related data. Now in order to do that, I need to know how to list the names of the tables and fields in the tables in the database. This would help me to choose tables and further choose fields in those tables to set relationships between them. How do I do that? Please help. Peace, Shivboy -- shivboy ------------------------------------------------------------------------ shivboy's Profile: http://www.excelforum.com/member.php...o&userid=35137 View this thread: http://www.excelforum.com/showthread...hreadid=551602 -- shivboy ------------------------------------------------------------------------ shivboy's Profile: http://www.excelforum.com/member.php...o&userid=35137 View this thread: http://www.excelforum.com/showthread...hreadid=551602 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename imported MS Access field names | Excel Discussion (Misc queries) | |||
Excel Spreadsheet from Access. List of names changes as names are | Excel Discussion (Misc queries) | |||
Fetch list of table names in access to a record set | Excel Programming | |||
Get table names from access through vba in excel | Excel Programming | |||
retrieving table names from Excel and Access sources using ADO | Excel Programming |