count unique fields in Access Report

Joined
Mar 19, 2010
Messages
1
Reaction score
0
I know that the following question has been asked a few times, but I must say I have never completely understood the answers to it. I want to count unique values in a particular field in a structured report.

In the detailed section of the report I have, for example:

Field [ID] Field [Destination]
ID1 Hamburg
ID2 London
ID3 Munic
ID2 Paris
ID3 Lyon
ID3 Basel

In the header (or the footer), I would like to write something like :

"3 IDs went to 6 destinations".

I don't really care how one would arrive there, but I would need to know what to put into that box to make it happen. I thought along the lines of the following, but might be completely off:

I can easily count the destinations, e.g., putting a box in the report of the type

= count([ID])

I would love be able to have a function such as :

=unique([ID])

I wrote a function of the type:

function funcShowRecord(MyVar as String) as String

and call it in the box as =funcShowRecord([ID])

the function was able to show me the first item of the list above. But that's obviously not enough. If I delcare:

function funcShowRecord(MyVar() as String) as String

I get an error message.

Now, writing the function is not a problem, but I don't know how to pass on [ID] as a variable. Obviously, the report knows how to pass on this as a variable, but I don't know what type it would be.

Again, I might go about it completely wrong, but perhaps you guys have an idea.

Thanks in advance
 

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

Similar Threads

Report by Group 1
Reports 1
Count unique students at report footer 2
Access count a field in access report 2
Count Unique Records 4
VB coding help sought 1
Count funtion in report-I'm too rusty! 1
record count in report 2

Top