Displaying the number of records updated

J

Jeff Garrison

All -

Is there a way to show the number of records updated/added/deleted when a
query runs? I know that if you leave the system messages on, it will show
that, but by leaving the messages on, you get all of the crap you don't want
to see...namely, "You are about to run a query..."

Ideally, what I'd like to do it to pop a message box that says "You have
just updated x records.". Strictly informational, no Yes or No
buttons...just a confirmation dialog.

Thanks.

JeffG
 
G

Guillermo_Lopez

All -

Is there a way to show the number of records updated/added/deleted when a
query runs?  I know that if  you leave the system messages on, it willshow
that, but by leaving the messages on, you get all of the crap you don't want
to see...namely, "You are about to run a query..."

Ideally, what I'd like to do it to pop a message box that says "You have
just updated x records.".  Strictly informational, no Yes or No
buttons...just a confirmation dialog.

Thanks.

JeffG

I don't know if there is an easy way to do it, but you can calculate
the number of Updates/Adds/Deletes that you are going to make. If you
build a query with the same parameters and you count the records
there, you get the number, and then you can display it however you
want.

If your update looks like this,

UPDATE
SET
.Field1= "xx",
.Field2= "xx"
WHERE (((
.Field3)="xxx"));

you can do something like:

rs.open "Count(Table.Field1) as CountUpdates From Table WHERE
(((
.Field3)="xxx"));", cn
MsgBox "The total number of rows updated is: " & rs!CountUpdates
rs.close

That should give you an idea.

Still there might be a better way, but I don't know how.

- GL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top