Using DCOUNT on an action query

G

Guest

Hi

I need to find out the number of records an action query would get if run
and if its zero I'll skip it.

However DCount doesnt work with action queries. Is there a better way than
have a select query version of the action query and using Dcount on that.

I have to maintain two objects that way

Any help will be greatly appreciated

Thanks
Suzie
 
J

John W. Vinson

I need to find out the number of records an action query would get if run
and if its zero I'll skip it.

Ummm... why?

Just run it. If it does nothing, it does nothing and no harm done. You can
check the RecordsAffected to see what it did (or didn't) do:

Dim qd As DAO.Querydef
Set qd = CurrentDb.Querydefs("queryname")
qd.Execute dbFailOnError
if qd.RecordsAffected = 0 Then
<didn't do anything>
End If


John W. Vinson [MVP]
 

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