Passing Name value to SQL Statement

Sully38

Board Regular
Joined
Mar 9, 2004
Messages
167
This is probably a simple question: I am looking to copy all the records from one DB and load into another DB, as a simple form of backup, before users "massage" the data.
I thought this was going to be real simple but I can't get Access to allow me to let user select the name of the file. see code below


Dim strName As String
strName = InputBox("Name the Backup file:")

DoCmd.RunSQL ("SELECT test.* INTO strnameTEST IN 'I:\Backup\MFBackup.mdb' FROM Test")

Is this possible, any help is appreciated

(y)
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Never mind I have found the error in my code and corrected the problem... The stu-pid pills worked well this AM....

:oops:
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,325
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top