Super simple Count doing my head in.....?

zozew

Registered User.
Local time
Tomorrow, 03:35
Joined
Nov 18, 2010
Messages
199
Hey there all,

Im trying out something that should be the easiest thing in access i presume, but for me.....im going nuts!

I got a INSERT INTO SQL in VBA, the result is populated an existing table. Then..tata...i want to COUNT the records in that table, use the COUNT to loop through them and populate one field with multiple values i get from another table. The second Table is a linked Table (through an ID) that has multiple values for each record (ID) in the SQL result. The last part i have no problems with...

I know this is easy i just can't find a way to do it....

I know that i should probably build a recordset first do all my looping and populating fields and then populate the table...but i cant get that working either...so i took the easy way I thought through an existing table but i got stuck at the COUNT of the records.

So i know there are multiple ways of doing this, just cant figure out how...any links to examples would be very appreciated :)

Thx
 
have you tried this in your code:
Code:
Dim LTotal As Long 
LTotal = DCount("<Field Name>", "<Table Name>")
 
Well there you go! Im blind. I came across the Dcount method but I must have forgot to test it.. :D

Thank you so much!
 

Users who are viewing this thread

Back
Top Bottom