Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Naz Naz is offline
external usenet poster
 
Posts: 85
Default Access queries/tables

Hello all,

How can i get a list of the table and querie names in an access database
into a spreadsheet?
--

_______________________
Naz,
London
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Access queries/tables

I use the following subroutine to produce document lists for my various
databases.

I have a table named tblDocuments with a 2 columns, one for the document
name and another for its container. The code opens the table as recordset
object and the uses a FOR loop to loop through each container, and within
each container, each document, posting the document name in the first field
and the container name in the second. You could then export the table to
Excel or query it from Excel using MS Query.

Sub ContainerContents()

Dim dbs As DAO.Database
Dim rst As DAO.RecordSet
Dim con As Container
Dim doc As Document
Dim strDocName As String
Dim strConName As String

Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tblDocuments")

For Each con In dbs.Containers
strConName = con.Name
For Each doc In con.Documents
strDocName = doc.Name
With rst
.AddNew
.Fields(0).Value = strDocName
.Fields(1).Value = strConName
.Update
End With
Next doc
Next con

rst.Close

Set dbs = Nothing
Set rst = Nothing
Set con = Nothing
Set doc = Nothing

End Sub
--
Kevin Backmann


"Naz" wrote:

Hello all,

How can i get a list of the table and querie names in an access database
into a spreadsheet?
--

_______________________
Naz,
London

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Access and Oracle Chris K Excel Discussion (Misc queries) 1 February 17th 06 06:16 PM
Cannot save Project file as MS Access file Jumpinjackflash Excel Discussion (Misc queries) 1 January 11th 06 11:35 PM
Linking Large Access Table into Excel Steven M. Britton Links and Linking in Excel 1 December 30th 05 11:28 PM
Excel and Access talking GJR3599 Excel Discussion (Misc queries) 0 March 29th 05 04:59 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


All times are GMT +1. The time now is 03:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"