Counting Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'am happy to found this place to work with my access file, because I got
only junior knowledge at msaccess.

In my report, "Vessel" is duplicate data, so how can I count it as one
record ?

vessel 1 xxxxx xxxxx
vessel 1 xxxxx xxxxx
vessel 2 xxxxx xxxxx
vessel 3 xxxxx xxxxx

vessel count = 3

Tks for the help !
Tom
 
Hi Tom,

In report design view, click on View > Sorting and Grouping. Select your
Vessel field as the Field/Expression. Make sure Group Header is set to Yes.
Close this dialog.

Add a textbox to the Vessel Header section. Name it: txtVesselRunningCount
Set it's Control Source =1, and Running Sum property = Over All. You can
set the visible property to No for this control.

In the Report footer, add a new textbox. Name it: txtVesselCount
Set it's Control Source to the following expression:

="Total Vessels: " & [txtVesselRunningCount]


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Dear Tom wickerath,

Tks U very much, it's work for clear report, but in my case the repot I only
group for the date & status, so without grouping the "vessel", if I add one
more group for "Vessel" then report will goes difference !

Week status dtls
2006-41 A xxxx
2006-41 B xxxx

2006-42 A xxxx
2006-42 B xxxx

Tks U again !
Tom
nnnn
///////////////////////////////////////

Tom Wickerath said:
Hi Tom,

In report design view, click on View > Sorting and Grouping. Select your
Vessel field as the Field/Expression. Make sure Group Header is set to Yes.
Close this dialog.

Add a textbox to the Vessel Header section. Name it: txtVesselRunningCount
Set it's Control Source =1, and Running Sum property = Over All. You can
set the visible property to No for this control.

In the Report footer, add a new textbox. Name it: txtVesselCount
Set it's Control Source to the following expression:

="Total Vessels: " & [txtVesselRunningCount]


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

tom said:
I'am happy to found this place to work with my access file, because I got
only junior knowledge at msaccess.

In my report, "Vessel" is duplicate data, so how can I count it as one
record ?

vessel 1 xxxxx xxxxx
vessel 1 xxxxx xxxxx
vessel 2 xxxxx xxxxx
vessel 3 xxxxx xxxxx

vessel count = 3

Tks for the help !
Tom
 
Dear Tom Wickerath,

Yes pls .....

Because after add the grouping "Vessel" the report goes totally difference,
becuase report no need to group by "Vessel".
It will come out as :

Week Status Dtls
2006-41 A xxxx
2006-41 B xxxx

2006-41 A xxxx
2006-41 B xxxx

2006-42 A xxxx
2006-42 B xxxx

2006-42 A xxxx
2006-42 B xxxx
I think becuase adding the Vessel group, so how to fix it ?

Many Tks !!!
Tom
nnnn
///////////////////////////////////
 
If you cannot group by Vessel, then perhaps your best alternative is to use
the domain aggregrate function DCount to count unique vessels. Here is a web
page that shows examples of using DLookup:

DLookup Usage Samples
http://www.mvps.org/access/general/gen0018.htm

You'll want to enter an expression that uses the DCount function as the
control source for a text box on your report. Something like this:

=DCount("FieldName" , "TableName")

Hopefully, you have a table where each vessel type is entered only one time.
If not, you can substitute a select query for "TableName" in the above
expression, where your query returns a distinct list of vessel types.

If your report's recordsource includes any criteria that reduces the number
of vessels, you will need to use similar criteria in the DCount function.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Dear Tom Wickerath,

Tks U very much for yr help, but I think I need time to solve the my
problem, because I'am the very junior for msaccess.

Anyway Tks again !
Tom
nnnn
///////////////////////////////
 

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

Back
Top