PC Review


Reply
Thread Tools Rate Thread

count unique fields in Access Report

 
 
New Member
Join Date: Mar 2010
Posts: 1
 
      21st Mar 2010
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count or sum unique records in a report's group footer in Access 2 Terri G Microsoft Access Reports 2 2nd Oct 2009 07:51 PM
How to use pivot table to count repeats of unique fields Susienak Microsoft Excel Misc 4 1st Aug 2008 11:15 AM
count unique fields megz12 Microsoft Excel Worksheet Functions 2 8th Feb 2008 04:53 PM
Count Unique Fields Only Joe Microsoft Access Queries 1 25th Jan 2006 09:13 PM
access 2000 adding count fields into a report marnita F via AccessMonster.com Microsoft Access Reports 1 26th Sep 2005 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:36 PM.