Hi everyone,
I'm new to the forum because I have a unique question that doesn't seem to be answered anywhere in the far reaches of Google (at least that I've seen).

I'm trying to export multiple Access tables to tab delimited .txt files. Other people may have different versions of the database and it has to upgrade for them too, so I can't specify tables. I have to do it generically with a loop.

acExportDelim defaults to commas, which won't do because of the data within the DB. I have successfully used export specs to make specific tables tab delimited, but the specs are table-specific, and there doesn't seem to be a way to globally set them. Even if there were, I'm trying to write a script that anyone can run regardless of the table names they have. I was wondering if there was a way that I could use my code to specify a spec to each table without having to manually go into the export menu for each table. My current code is below.

-------------------------------------------------------------------
Sub Main()

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Dim tdfs As DAO.TableDefs

Set dbs = CurrentDb()

For Each tdf In tdfs

' Check to see if ! system table
If Left(tdf.Name, 4) <> "MSys" Then
'Output tables to (table name).txt using "newSpec" specification, with no table headings
DoCmd.TransferText acExportDelim, "newSpec", tdf.Name, "C:\Documents and Settings\ssylves\Desktop\dat\" + tdf.Name + ".txt", False
End If

Next




End Sub
---------------------------------------------------------------------