Prompt User For Table Name

V

vivek.vbansal

Hi I am Using Microsoft Access 2003. I have a problem getting the name
of the Table. I want to prompt the user for the name of the table so
that i could run a append query. the syntax of the query is like as
following:
Insert into (Column_Names) Select (Column_Names) From
"Get_Table_Name_From_User". Could anyone please help me with this
query.

ThankYou
 
A

Allen Browne

Execute the action query statement in VBA code.
You can then include the table in the query string.

This kind of thing:
Dim strSql As String
Dim strTable As String

strTable = Trim$(InputBox("Table name?"))
If strTable <> vbNullString Then
strSql = "INSERT INTO ...
dbEngine(0)(0).Execute strSql, dbFailOnError
End If
 
P

Punjabi!!!!!!!

Allen said:
Execute the action query statement in VBA code.
You can then include the table in the query string.

This kind of thing:
Dim strSql As String
Dim strTable As String

strTable = Trim$(InputBox("Table name?"))
If strTable <> vbNullString Then
strSql = "INSERT INTO ...
dbEngine(0)(0).Execute strSql, dbFailOnError
End If



Thank You Very Much For Your Help Allen. It Worked. :)
 

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