Get count of append without appending?

  • Thread starter Thread starter news2
  • Start date Start date
N

news2

I have several append queries. I would like to know how many records each
would add to the target table without actually adding those records (the
decision as to whether to add or not may be subjective).

Is there a way other than duplicating the append queries with a select
query?

Dick Cleaveland
 
hi Dick,

Is there a way other than duplicating the append queries with a select
query?
No, not really.


Option Compare Database
Option Explicit

Public Sub CountAppending()

On Local Error GoTo LocalError

Dim db As DAO.Database

Set db = CurrentDb

BeginTrans

db.Execute ("INSERT INTO CountAppending([Value]) VALUES ('1')")
MsgBox "Appending: " & db.RecordsAffected

LocalError:
Rollback

End Sub


btw, use to queries:

the first selects the records to insert, the second one does the insert.
So a simple DCount() gives you to estimated rows to insert.

mfG
--> stefan <--
 

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

Back
Top