Solved Dcount

mdshuja

New member
Local time
Today, 15:30
Joined
Mar 9, 2022
Messages
3
Hi

I am using count function to bring total count of particular Customer ID, Count: [Polnumber] & "/" & DCount("*","CommissionDetail","[Polnumber]='" & [PolNumber] & "'"), i got perfect result XXXXXX/9 OR XXXXXX/10 OR XXXXXXX/12
I am looking XXXXXX/1 of 1, XXXXXX/1 of 2, XXXXXX/1 of 3 etc.,
or XXXXXX/1 of 9, XXXXXX/2 of 9, XXXXXX/3 of 9 etc.,

kindly help

Thanks
Shuja.
 
Count: [Polnumber] & "/" & DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "'")-DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "' AND [Your RECORD ID FIELD]>" & [Your RECORD ID FIELD]) & " of " & DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "'")
or
SQL:
... [Polnumber] & "/" & DCount("*","CommissionDetail","[Polnumber]='" & [smdFirstName] & "'")
-DCount("*","CommissionDetail","[Polnumber]='" & [Polnumber] & "' AND [Your RECORD ID FIELD]>" & 
[Your RECORD ID FIELD]) & " of " & 
DCount("*","CommissionDetail","[Polnumber]='" & [Polnumber] & "'") AS TCount ...

Change "Your RECORD ID FIELD" to your name of field.
Beter sort order: [Polnumber], [Your RECORD ID FIELD]
 
Count: [Polnumber] & "/" & DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "'")-DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "' AND [Your RECORD ID FIELD]>" & [Your RECORD ID FIELD]) & " of " & DCount("*";"CommissionDetail";"[Polnumber]='" & [Polnumber] & "'")
or
SQL:
... [Polnumber] & "/" & DCount("*","CommissionDetail","[Polnumber]='" & [smdFirstName] & "'")
-DCount("*","CommissionDetail","[Polnumber]='" & [Polnumber] & "' AND [Your RECORD ID FIELD]>" &
[Your RECORD ID FIELD]) & " of " &
DCount("*","CommissionDetail","[Polnumber]='" & [Polnumber] & "'") AS TCount ...

Change "Your RECORD ID FIELD" to your name of field.
Beter sort order: [Polnumber], [Your RECORD ID FIELD]

Thanks for your reply,

Sql & Function is not working, i have attached Access File, If possible Please update in Access,

is it possible to create Unique ID Column in Tables should calculate count formulas and store in the Unique ID Column

Thanks
 

Attachments

Thanks for your reply,

Sql & Function is not working, i have attached Access File, If possible Please update in Access,

is it possible to create Unique ID Column in Tables should calculate count formulas and store in the Unique ID Column

Thanks
Amazing, It's Working Thanks a lot.
 

Users who are viewing this thread

Back
Top Bottom