Append Query - Automatically change table

TheToeOfPooh

Active Member
Joined
May 21, 2004
Messages
254
I currently link new excel worksheets on a dialy basis.

I then use a variety of Append Queries to manipluate the data and produce reports.

Can anyone recommend a way of automating the process by which a new table is selected by an Append Query.

e.g. In the following I would like to have perhaps an Input box which says
"Enter new Table".
The user would then enter e.g Julyprn15.
All refferences to July14 would then be altered and the Query run.

Sample of current code taken using SQL View.INSERT INTO tblTemplateYESTERDAY ( WFlowJobNo, JESJob, JESJobNo, System, Account, Owner, FormType, Class, FormDef, Pages, Copies, Printer, StartDate, StartTime, EndDate, EndTime, PrintedSheets, PagesProcessed, PrintError, Incomplete, AReprint )
SELECT Julyprn14.Field1, Julyprn14.Field2, Julyprn14.Field3, Julyprn14.Field4, Julyprn14.Field5, Julyprn14.Field6, Julyprn14.Field7, Julyprn14.Field8, Julyprn14.Field9, Julyprn14.Field10, Julyprn14.Field11, Julyprn14.Field12, Julyprn14.Field13, Julyprn14.Field14, Julyprn14.Field15, Julyprn14.Field16, Julyprn14.Field17, Julyprn14.Field18, Julyprn14.Field19, Julyprn14.Field20, Julyprn14.Field21
FROM Julyprn14;

Any help would be very much appreciated.

Bernard
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,221,780
Messages
6,161,888
Members
451,730
Latest member
BudgetGirl

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