Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying list of tables using VB code in Access

Status
Not open for further replies.

Alastor

MIS
Aug 27, 1998
36
US
I am trying to automate the importing of data into a database. I have created a form that uses VB code import the data and modify it to it's proper format. I then use a SQL statement to append the data to a table. Unfortunately I can't get around hard coding the table name into the SQL statement. I would like to display a list of tables for the user to choose from, and then put the table name into the SQL statement. Is this possible? Any help would be appreciated.
 
You may have to use a SELECT CASE statement and use separate SQL statements in each case...
 
I was hoping for something a bit more dynamic. The Select Case statement did work however. Thanks.
 
You could use a For Each loop to loop through the TableDefs collection. Each TableDef is a table in your database. You can use the variable from the For Each loop in your SQL expression. If you get stuck, just shout...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top