A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Run all queries in a group



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2008, 08:31 PM posted to microsoft.public.access.queries
CFitz
external usenet poster
 
Posts: 4
Default Run all queries in a group

Is there any way to run all of the queries that are in a group? I could
always make a macro that runs each query but it'd be easier if there was just
one action. I have about 40 update queries that need to run.
  #2  
Old May 13th, 2008, 11:32 PM posted to microsoft.public.access.queries
fredg
external usenet poster
 
Posts: 4,386
Default Run all queries in a group

On Tue, 13 May 2008 12:31:00 -0700, CFitz wrote:

Is there any way to run all of the queries that are in a group? I could
always make a macro that runs each query but it'd be easier if there was just
one action. I have about 40 update queries that need to run.


Use code.
CurrentDb.Execute "QueryA", dbFailOnError
CurrentDb.Execute "QueryB", dbFailOnError
CurrentDb.Execute "QueryC", dbFailOnError
CurrentDb.Execute "QueryD", dbFailOnError
etc.

Or if you name each update query in sequential order, i.e.
"Query1","Query2","Query3", etc. you can loop through them quite
simply:

Dim strName as String
Dim intX as Integer
For intX = 1 to 41
strName = "Query" & intX
CurrentDb.Execute strName, dbFailOnError
Next intX

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.