How can I count the number of records in Update query

danial

Board Regular
Joined
Apr 29, 2006
Messages
107
How can I count value in Update queryHow can I count the number of records in Update query

Because I don't want create normal query for count it.
Realy I want to count rec. before update data
any way for me?

Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
In code, I don't think you can do it.
Also, I don't think you can use an action query as a data source for another query.

The reason is that, whenever you work with records in a query, Access works with the associated Recordset -- and you cannot create a Recordset from an action query as far as I know.

So, if you want to know the Sum and the Count of a set of records, you need to work with a standard query -- you can see the Count on the warning that Access is about to update xx records, but that's about it.

Denis
 

danial

Board Regular
Joined
Apr 29, 2006
Messages
107
I have a form for interface with user.
I want to show the count of record on the form as below

Code:
My Form

Do you want to update [240] records
[Click hear for update]

but if that "query update" have not data.
I want to show
Code:
Can't not updata data now!
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi Danial
Instead of using the update query as the source for the number of records, use another query that uses the identical criteria to count how many records would be updated by the other query.
HTH, Andrew
 

Forum statistics

Threads
1,137,330
Messages
5,680,857
Members
419,936
Latest member
rphill48

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
Top