Count on Query and Displaying result on a switchboard

ciskid

Registered User.
Local time
Today, 15:08
Joined
Jul 24, 2006
Messages
30
Hi Folks

More questions from the newbie :eek:

I have a very simple table with a field that will have only the values open or closed

I created a query based on this table and used the count function (to count open or closed cases) and in the next querie field I used the group by open.

This gives me a count of all open cases

I can do the same for closed cases.

I want this count to be displayed on a Switchboard form but i cant get my nehad round how to get it there.

Can anyone help me out ?

Many thanks

Jimmy
 
Use DCount() rather than an aggregate query as the data source for a text box on your form.
 
neileg said:
Use DCount() rather than an aggregate query as the data source for a text box on your form.


Hi Neileg

Can you be more specific ?

For instance I have a table that has filed of different colours

Red , green , blue

If I create a form from this table , Do I build an expression to show the dcount total of these words , or a macro , or code ?

That's what I'm struggling with.

Can I use the expression builder ?

Thanks again

Jimmy
:confused:
 
Have you looked at Access Help for DCount()?

You can use the expression builder.
 
Hi neileg


Still trying to use the expression bulder to do this.

Can I confirm some action points with you ?

So I have a form based on a table or query.

Say I have a field within this table or query called "count"

This is a field that has a value of 1 , so every time there is a new record, a "1" appears in this filed.

I then goto my form in design view , create a text box, right click and use the expression builder and write something like :-

=DCount("*","
","[count] = '1'")



Is the above correct.

br

Jimmy
 
First thing, Count is a reserved word so you shouldn't use it as a field name say OpenClose. If [Count] has a value of 1 in every record I can't see the point so I presume you mean it is set to 1 for closed and zero for open (or vice versa).

With DCount you only use "*" without a criterion, DCount("*","table"). What you need is to specify a field (any one that isn't null, perhaps the primary key). DCount("PK","table","[OpenClose]='1'")
 
Hi neileg

Ok now all sorted.

Chuffed, many thanks for this.

Its really sorted me out.

br

Jimmy
 

Users who are viewing this thread

Back
Top Bottom