|
|
Select Queries in Macro - Close all windows
Hi
I have created a Macro with 20+ "Select Queries". When the Macro is
run with the "OpenQuery" action, because these are "Select Queries" it
is opening all of them in several windows. I want to either :
1. Run these queries without opening a window
2. Close all query windows after the Macro is complete.
I know that its odd to have so many "Select Queries" - I didn't create
the database, so rather than start from scratch I'd like to clean it
up a bit.
Any help would be appreciated!
Thanks.
|
|
0
|
|
|
|
Reply
|
holeyanna
|
5/7/2007 2:40:17 PM |
|
What is the purpose of openning a select query and then closing it?
When you run a select query it's because you want to view the resault of it
so why close it?
Action queries (update, delete , append) run's to update the records and
they don't open a new window.
--
Good Luck
BS"D
"holeyanna" wrote:
> Hi
>
> I have created a Macro with 20+ "Select Queries". When the Macro is
> run with the "OpenQuery" action, because these are "Select Queries" it
> is opening all of them in several windows. I want to either :
>
> 1. Run these queries without opening a window
> 2. Close all query windows after the Macro is complete.
>
> I know that its odd to have so many "Select Queries" - I didn't create
> the database, so rather than start from scratch I'd like to clean it
> up a bit.
>
> Any help would be appreciated!
>
> Thanks.
>
>
|
|
0
|
|
|
|
Reply
|
Utf
|
5/7/2007 5:52:01 PM
|
|
That's what my problem stems from - The original owner of the database
created a series of select queries to calculate the sum of a field for
particular groups. So a separate select query was created for each
group (over 30). I just want to create a macro that will run these
select queries to calculate the sum so I can append to a master file.
But when I create a macro with the openquery action, I end up opening
like 40 windows.
Any ideas? Is there a macro or VBA that I can use to close all query
windows once the macro is completed?
On May 7, 1:52 pm, Ofer Cohen <OferCo...@discussions.microsoft.com>
wrote:
> What is the purpose of openning a select query and then closing it?
>
> When you run a select query it's because you want to view the resault of it
> so why close it?
>
> Action queries (update, delete , append) run's to update the records and
> they don't open a new window.
>
> --
> Good Luck
> BS"D
>
> "holeyanna" wrote:
> > Hi
>
> > I have created a Macro with 20+ "Select Queries". When the Macro is
> > run with the "OpenQuery" action, because these are "Select Queries" it
> > is opening all of them in several windows. I want to either :
>
> > 1. Run these queries without opening a window
> > 2. Close all query windows after the Macro is complete.
>
> > I know that its odd to have so many "Select Queries" - I didn't create
> > the database, so rather than start from scratch I'd like to clean it
> > up a bit.
>
> > Any help would be appreciated!
>
> > Thanks.
|
|
0
|
|
|
|
Reply
|
holeyanna
|
5/7/2007 6:02:38 PM
|
|
holeyanna wrote:
> That's what my problem stems from - The original owner of the database
> created a series of select queries to calculate the sum of a field for
> particular groups. So a separate select query was created for each
> group (over 30). I just want to create a macro that will run these
> select queries to calculate the sum so I can append to a master file.
> But when I create a macro with the openquery action, I end up opening
> like 40 windows.
>
> Any ideas? Is there a macro or VBA that I can use to close all query
> windows once the macro is completed?
What is his code doing to get the sum once all the queries are open?
Chances are you can just remove the steps that open the queries. Anytime
you refer to values in queries from code the queries are automatically run
in the background. The ONLY reason to "Open" a select query is if you want
to look at it.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
|
|
0
|
|
|
|
Reply
|
Rick
|
5/7/2007 6:12:13 PM
|
|
|
3 Replies
514 Views
(page loaded in 0.057 seconds)
Similiar Articles: Select Queries in Macro - Close all windows - microsoft.public ...Hi I have created a Macro with 20+ "Select Queries". When the Macro is run with the "OpenQuery" action, because these are "Select Queries" it is open... Macro and append queries - microsoft.public.accessSelect Queries in Macro - Close all windows - microsoft.public ... I just want to create a macro that will run these select queries to calculate the sum so I can append to ... Macro to select a folder and delete all messages - microsoft ...Macro to select a folder and delete all messages - microsoft ... Use Macro to Select printer in Word 2007 on Windows 7 Pro ... Select Queries in Macro - Close all windows ... excel pivot table with sql query and visual basic macros ...... Then rsData.Close ... that runs off a sql query, it has macros ... for Applications macro while a query is ... pivot table or a query table ... A1"), Sql:="Select ... Windows Vista, Office 2007 macros enabled - microsoft.public ...Select Queries in Macro - Close all windows - microsoft.public ... Windows Vista, Office 2007 macros enabled - microsoft.public ... Select Queries in Macro - Close all ... Moving/copying Macros - microsoft.public.word.docmanagement ...Select Queries in Macro - Close all windows - microsoft.public ... Select Queries in Macro - Close all windows - microsoft.public ... Select Queries in Macro - Close all ... Macro to run without spreadsheet being open - microsoft.public ...Select Queries in Macro - Close all windows - microsoft.public ... Run these queries without opening a ... Run a macro to open and run a ... all windows DataBase Hi I have ... Clear form after append query - microsoft.public.access ...Select Queries in Macro - Close all windows - microsoft.public ... Clear form after append query - microsoft.public.access ..... microsoft.public.access.modulesdaovba ... Run a Query using VBA without User Interface - microsoft.public ...Hello, I have a VBA Macro that Opens an Append Query (see ... Days, Recurring_Until ) SELECT ... VBA ... with the graphical query interface. Running ... its Windows ... Retrieve query fields in a VBA variable - microsoft.public.access ...Hi all, I was wondering if there is a method to capture the out come (a specific data field) from a query in to a VBA variable. ... String > > > > strSQL = "SELECT ... Select Queries in Macro - Close all windows DataBaseHi I have created a Macro with 20+ Select Queries. When the Macro is run with the OpenQuery action, because these are Select Queries it is opening all of Select Queries in Macro - Close all windows - microsoft.public ...Hi I have created a Macro with 20+ "Select Queries". When the Macro is run with the "OpenQuery" action, because these are "Select Queries" it is open... Select Queries in Macro - Close all windowsHi I have created a Macro with 20+ "Select Queries". When the Macro is run with the "OpenQuery" action, because these are "Sel OpenQuery Macro Action - Microsoft Corporation: Software ...Close Macro Action ... pane shows all queries in ... action you can select additional options. Tips You can drag a query from the Navigation Pane to a macro ... Automate applications with macros in Access 2007 - Access - Office.comWith macros, you can: Open any table, query, form, or report in any available view or close any open table ... Execute a select query or an ... current macro or all macros ... 7/25/2012 1:34:19 PM
|
|
|
|
|
|
|
|
|