Table name as parameter in SQL query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'd like to create a query in Access that will prompt me for the table name from which to get the data. Since I'm not very familiar with SQL I normally create a query using the QBE grid, switch to SQL view and make changes.

Ultimately I'm going to use this query from a VB.net program and will be looping through a sequence of tables as my data sources.

I'd appreciate any help, hints or suggestions.

Thanks,

Art
 
Hi,

I'd like to create a query in Access that will prompt me for the table name from which to get the data. Since I'm not very familiar with SQL I normally create a query using the QBE grid, switch to SQL view and make changes.

Ultimately I'm going to use this query from a VB.net program and will be looping through a sequence of tables as my data sources.

I'd appreciate any help, hints or suggestions.

You cannot pass a table name as a Parameter to a query; you'll have to
have your VB.Net program actually construct a SQL string.

I'm queasy about your table design - multiple identically-structured
tables are generally A Bad Idea. Are you storing data in tablenames?
What are these tables?
 
Seems to me that you could import to a single table, then update the master
table from there. If there are errors you can always delete a single months
transactions from the master table. No need to store each month in a
separate table and in the master as well. It sounds like you are keeping
the monthly text files anyway, so you could always go back and redo the
entire process.

Dale
 
Dale,

Thanks. I'm trying to do much of my work through VB.net -- something I'm just learning. I'll pop over to that discussion area to find out how to submit a command such as application.docmd.trasfertext - so that I may be able to do what you suggest.

Art
 
Back
Top