Simple problem

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

Guest

I want to run following code

DoCmd.OpenTable "New", acViewPivotTable

But I want the name of the table to be taken from string variable "Name".
How is it done. Must be simple thing, but I can't find answer. Could somebody
help? Thanks!
 
so, if your variable name is Name then:

dim Name as string
Name="MyTable"
DoCmd.OpenTable Name, acViewPivotTable
 
First thing, don't use the word name. It is a reserved word in Access and it
will be confusing. Try calling it something else. Same thing goes for new.

strSomethingElse = "tblNew"
DoCmd.OpenTable, strSomethingElse, acViewPivotTable
 
Back
Top