Count value trouble

S

scruffy

I'm trying to display the total counts of all Units that use a particular
part from inventory to show in a report using the field UCode from a query.
It works perfect when listing all individual Units but I need to get the
combined total for all the Units that use the part to show. (I always end up
with 1 showing in the report).

Ex.
UModel ' Unit Model that uses the part
UCount ' Count of each type of unit
UCode ' Unit Code used by each unit
PartNum ' Part Number
PDesc ' Part Description

UCode= 1 and UCode= 2 are listed together as UCode=17
UCode= 8 and UCode= 9 are listed together as UCode=18

The queries filter for UCode <> 17 and <> 18 and I get the results I want
however when I try to carry the totals for combined units to the report I
always get 1 for the total although I should get [Count of UCode 17] = 26 and
[Count of UCode 18] = 7.


For Each PartNum
If UCode=1 or UCode=2 then
UCount(17) = (UCount(17) +1)
End If
Next
Next PartNum

I've missed something somewhere but I'm not sure where it is...any help
would be appreciated.

scruffy
 
S

scruffy

I found what I was missing - I was only using one group header section and
need to use 2 for it to work.
 

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

Top