Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCOUNT

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I am trying to determine how many rows I have in my recordset. Usually, I will use the following:

tempnum = DCOUNT("*", TableName, "Table_ID = " & 4)


I am using a recordset that involves 3 tables, but I want to know how many values I am pulling over. Is there anyway to say:

tempnum = DCOUNT("*", MyRecSet)

I tried MyRecSet.RecordCount, but that displayed 1 every time and not the value that it should have. Any ideas? Thanks!
 
hi

If you are trying to find out how many records 3 different tables hold the id 4 then first you should do a union query
then do a count on the recordset of the union query

If you need help with the union query

post the table names and the fields holding the id and I'll post you back the method

regards

jo
 
Thanks for your help, but I think my problem is just that when I do Msgbox(RecSet3.RecordCount), Access outputs a 1 when there are actually 4 entries selected, or at least there are when I paste the sql into the query thing. Any ideas on what is going on?
 
Hi there
just a quick thought to use recordset.recordcount you have .movelast otherwise you will only get 1 could you try this and check it out

regards

jo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top