I'm copying a table into a newly renamed database with the statement SELECT INTO IN FROM. As long as I provide the full path within the single quotation mark everything works fine. But I want to provide the new database name as a a string. I tried all the combinations (single quotation marks, double qutation marks) but nothing works, it always gives me an error. Anybody has solution for that? Any help will be more than appreciated. Here is the code I'm trying to execute.
Code:
strDBName = "C:\MATLAB\DB\NEWPROJECTS\NEW_DBPROJECT" '******This is the working statement 'DoCmd.RunSQL " SELECT * INTO [tblPortfolioRepartition] IN 'C:\MATLAB\DB\NEWPROJECTS\NEW_DBPROJECT' FROM [tblPortfolioRepartition] " '******This is the non-working statement DoCmd.RunSQL " SELECT * INTO [tblPortfolioRepartition] IN ' ' & strDBName & ' ' FROM [tblPortfolioRepartition] "
Comment