creating row counter

anissw

Registered User.
Local time
Today, 18:31
Joined
Jun 11, 2012
Messages
55
Hi. I have a table that I have created for generating invoices. My program and codes work, however, I need to include a row counter for the invoice table. So far, when I initiate a count using DCount, it will generate the count of total number of records, (17 records in a table for each record will say 17 for each record instead of 1,2,3, etc...). My table only unique field will be a combination of 2 text fields. Can someone give me some insight of setting my row counter?

Thank you-

Anissw
 
If you simply want to as a count to your table you can use DMax() plus one. The attached sample show one way this can be done.
 

Attachments

To do this in a query, you could use the following syntax;
Code:
SELECT DCOUNT("YourField","YourTable","YourField <= '" & [counter] & "'") 
  AS RowNumber,  
  YourField as counter FROM YourTable;
Which will probably be quiet slow if you have a lot of records.
 
Hi John-

Thanks for replying. I'll test it and let you know how it went. :)
 
Hi John-

Thank you so much!!! :) It worked like a charm!!

Sorry for the delay in replying.
 
Hi John-
I came across another dilemna. I have a query that is accessing another query for total of rows grouped by account number. E.g. The query is displaying 3 rows, however there are 2 values for account number. The total will display 3 instead of 2. I tried the DCOUNT syntax and the result will still display 3. Any suggestions?

Thanks-

Anissw
 

Users who are viewing this thread

Back
Top Bottom