Creating a Macro to run multiple Queries - Help

lwilt

Board Regular
Joined
May 16, 2013
Messages
187
When making a new macro to run a list of queries, let's say 5 queries for example, I pick the action to be OpenQuery but I can't seem to figure out what I need to pick for the drop downs for View and Data mode so that the Query will just run to the make table I have in design mode.

Is choosing OpenQuery correct? If not what action should I use? And what do I pick for the drop downs?
 
Code:
INSERT INTO [RFM Test Table] ( [RFM Code], Cust_NO, [Last Order], [Avg Order], [Number of Orders], [First Contact Method] )
SELECT "A1B" AS [RFM Code], [RFM Customers and Orders].Cust_NO, Last([RFM Customers and Orders].[Order Date]) AS [Last Order], Avg([RFM Customers and Orders].Sales) AS [Avg Order], Count([RFM Customers and Orders].[Order Number]) AS [Number of Orders], First([RFM Customers and Orders].[First touch]) AS [First Contact Method]
FROM [RFM Customers and Orders], [GlobalSettings]
GROUP BY "A1B", [RFM Customers and Orders].Cust_NO
HAVING (((Last([RFM Customers and Orders].[Order Date]))>=[GlobalSettings].[StartDate] And (Last([RFM Customers and Orders].[Order Date]))<[GlobalSettings].[EndDate]) AND ((Avg([RFM Customers and Orders].Sales))<220) AND ((Count([RFM Customers and Orders].[Order Number]))>=16) AND ((First([RFM Customers and Orders].[First touch]))<>"Internet" And (First([RFM Customers and Orders].[First touch]))<>"WEB"));
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

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