MS Access Expression Help!

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Sonny100

Thread Starter
Joined
Jul 10, 2006
Messages
8
Afternoon all,

I am trying to write an expression in Access, but i'm having a little trouble!

Basically, I'm searching a table for all entries that match the current records Primary Key, the field that the expression is in then displays the number of entries.

I currently have...... =DCount("*","Date table","[Analyst] =

I just need to know what to put at the end, the "[Analyst] =" part must equal the primary key of what ever record it's in at the time.

Any help would be appreciated!
 
Joined
Jun 17, 2002
Messages
2,556
All you need to do is create a query, add your primary key and whatever field you want to Count. then on the view menu select "Totals", the fields will default to Group by. change the one you are trying to count, to count. Then run.

*keep in mind that you may have to add additional fields fto "Group by" depending on the level you are trying to count, but don't try to create the full detail, you must group in order to get the count you are trying to achieve.....

this query can be joined to another table/query to show the count at the full record level, I can explain further if you don't know what I mean.
 

Sonny100

Thread Starter
Joined
Jul 10, 2006
Messages
8
The primary key that i'm referring to is in a differant table, but it's shown on the same form.

I have a form that feeds from one table, and on that form I have fields that gather information from a second table. I need to create an expression that searches for the number of records in the second table, that contain the primary key from the first.

The first table is a list of IT analysts, and the second is a list of service calls logged. I'm trying to create a form that displays the analysts names as each record, and within that, the amount of calls that they have logged (type etc).
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Sonny100, Ziggy1's Query will provide what you have described. If you want to list the records that is a different matter.
can you post a zipped copy of the database, less the data if necessary.
 

Sonny100

Thread Starter
Joined
Jul 10, 2006
Messages
8
Fantastic!!

Sorry guys, I didn't realise that you could run a query that gathers information from two differant tables! (i'm fairly new to Access!)

I now have the results that I require, that you very much for your help!!
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top