Copying all rows from basketContent to basketsContent

H

h3llz

If QryDat.BOF = False And QryDat.EOF = False Then
QryDat.MoveFirst

Part of my script, but i dont know how to loop to get all the rows in
basketContent, how can i find out how many rows returned ?
 
T

Tom van Stiphout

On Wed, 10 Dec 2008 02:37:00 -0800, h3llz

IMO copying data is best done with an Append query that takes
parameter(s).

If you insist in doing it with recordsets:
dim rsFrom as dao.recordset
dim rsTo as dao.recordset
set rsFrom = Currentdb.OpenRecordset(...)
set rsTo = Currentdb.OpenRecordset(...)
while not rsFrom.EOF
rsTo.AddNew
rsTo!SomeField = rsFrom!SomeField
rsTo!OtherField = rsFrom!OtherField
'etc.
rsTo.Update
rsFrom.MoveNext
wend
'Todo: close objects.

-Tom.
Microsoft Access MVP
 
J

John W. Vinson

how can i find out how many rows returned ?

Either

qryDAT.MoveLast
Debug.Print qryDat.RecordCount

or

Debug.Print DCount("*", "qryDat") <without opening the query at all>
 

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