Using DCOUNT on an action query

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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]
 
Back
Top