473,492 Members | 4,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Number of rows updated by each query within macro

1 New Member
I need to know how many rows are being updated by each query within a macro. My macro contains about 50 queries.

Is it possible to see the details for each query individually - without running each query individually?
Sep 22 '14 #1
4 1149
twinnyfo
3,653 Recognized Expert Moderator Specialist
secohen,

One thing I know for certain is that action queries cannot be used to create a recordset (and thus perform a recordcount) like normal queries can.

One possible way to do what you are trying to do is to convert your macro to VBA (and convert all your queries to SELECT Queries) and create recordsets for each iteration and perform a recordcount, followed by either executing the Action version of the query, or performing updates via the open recordset.

Since you are talking about 50 queries, this solution sounds like a lot of work (and it would be). But, I don't know how one would perform such functions within the Macro Environment (hence, I am also a strong proponent for moving away from macros and toward VBA).
Sep 22 '14 #2
zmbd
5,501 Recognized Expert Moderator Expert
Twinney,
secohen mentions "updated" so I suspect that secohen is using an update action query.

secohen, using macros and the standard method you should be receiving a pop-up for each update-query ran that states the number of records that will be effected by the query. If this is not happening then we need to see:

+ The version of Access you are running
+ The SQL of just one of the 50 the action queries being called, please format the sql using the [CODE/] format button in the post toolbar.
+ The macro you are running also formatted using the [CODE/] button. In ACC2003 and older you will need to type the commands in by hand. In ACC2007 and newer you can open the macro in design view, <ctrl><A>,<ctrl><C> then come back to this thread <ctrl><V> select the pasted text and click on [CODE/] formating button.
Sep 23 '14 #3
twinnyfo
3,653 Recognized Expert Moderator Specialist
Z,

I understood his post as asking how to find out the number of records affected. Obviously, if the warnings are set to False, he won't see the prompt to continue with the action query. If the warnings are one, he will see--whether he runs these queries individually or as mart of a macro that runs them all.

My post was regarding finding out how many records are affected "without running the query individually."

Obviously, without seeing each of the 50 queries (individually) this is nearly impossible--even knowing the names of these queries doesn't help much, because OP is specifically asking about the number of rows updated.

So, unless we take apart all 50 action queries and make them Select Queries, I know of no other method. However, I am eager to learn how to do such a thing with an action query, because I think there would be value in having such information available if I needed it. If you know a method, I will certainly monitor this thread for a solution.
Sep 23 '14 #4
zmbd
5,501 Recognized Expert Moderator Expert
+ there are ways to do this.
+ the execute method does not require warnings to be turned off.
+ both use the records effected method
+ we just need to see the mechanics OP is using
Sep 23 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
12032
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
4
8817
by: James | last post by:
Hello there, Does anyone know how to create a sequential record number field in a query?? Thanks, James
2
2071
by: Lacka | last post by:
Hi, If I have this sequence: Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(ConfigurationSettings.AppSettings("DB")) Dim dbCommand As...
2
2927
by: Mindy | last post by:
Hey, Does anyone know which function to run updated query in macro? I used "OpenQuery" function, but it seems doesn't work. No error message. The query is correct because I could run it...
2
2616
by: Michael.Suarez | last post by:
In MS Sql Server 2000, if you run a stored procedure that query's more than 8 databases, you get this error gets raised: Maximum number of databases used for each query has been exceeded. The...
1
2140
by: sherbert1967 | last post by:
How do I determine (from main form) what rows have been selected within a (datasheet style) subform. As I need to transfer these rows to another table. Can this be achieved via code? Please...
1
1822
by: clickingwires | last post by:
How do you consecutively number rows in an aggregate query?
1
2080
by: jeddiki | last post by:
Hi, I want to get a subset from my table that includes rows that have an item (cb_id) with a unique ip address ( ip_adr). To be in the subset there should be at least two rows and if there are more...
0
1530
by: jbrizu2 | last post by:
Hello - I am trying to run an oracle parallel query within a perl script but it will not work. I am getting the following error: ORA-24373: invalid length specified for statement (DBD ERROR:...
5
2524
by: jbrown8253 | last post by:
Microsoft Access 2007 Export Report for each record within a recordset I am attempting to click a button on a form that will export a report that is unique to each record. I created a query that...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.