exporting multiple tables

A

Angela

Hi,
I have 6 tables in my database.
Depending on which tables the user choses, I want to be able to export those.
So if the user picks 4 tables to export, I want to be able to export 4
different text files.
Please help.
Thank you.
 
P

PieterLinden via AccessMonster.com

Angela said:
Hi,
I have 6 tables in my database.
Depending on which tables the user choses, I want to be able to export those.
So if the user picks 4 tables to export, I want to be able to export 4
different text files.
Please help.
Thank you.

How does the user choose the tables? If you use a multi-select listbox, you
can loop through the ItemsSelected collection and export them.

dim varItem as variant
for each varItem in me.lbxItemList.ItemsSelected
docmd.TransferText .... varItem ... blah blah blah
next varItem

transferText exports each object selected to a different file...
 
R

ryguy7272

Sub Exporting()

Dim obj As AccessObject, dbs As Object

Set dbs = Application.CurrentData

' Check each object of the AllTables collection
For Each obj In dbs.AllTables
DoCmd.OutputTo acOutputTable, obj.Name, "MS-DOSText(*.txt)", "",
False, "", 0, acExportQualityPrint
Next obj
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top