Display Table Name in Query Results

LadyDi

Registered User.
Local time
Today, 01:15
Joined
Mar 29, 2007
Messages
894
Is there a way to display the name of a table in the query results?

I would like to evenutally set up a module to link to all .csv files in a certain location on my computer containing the word Summary in the title. Then I would like to include all those tables in an Append Query, and Append the data to a static table in the database that will collect the data from each spreadsheet. However, unless I can get the name of the table in the query, this is will not work. That is the only way I will know what information came from which spreadsheet.
 
If you create append queries for each table, add a "calculated" column with the table name. If you build the queries on the fly with VBA, do the same thing there:

Select fld1, fld2, "tableName" As fld3, ....
 
How can I calculate the "tableName"? When I add a column with these words to my query, I get a result column that says tableName, not the actual name of the table. If I change it the query to read "tableName()", it tells me that it is an undifined function. If I try "&tableName" in the query, I get a message telling me that the expression I entered is using invalid syntax.
 

Users who are viewing this thread

Back
Top Bottom