Total Entries For A Given Day

TheRadioboy

Registered User.
Local time
Today, 14:02
Joined
Sep 27, 2017
Messages
20
Could someone please help?

I wish to create, on a data entry form, a box that shows the total number of entries for today's date. My tabel includes a 'Department' field and I'd like to show the number of entries for the day by each department. Is there an expression that will do this please?

My date field is called [SCHEDULED] and my department field is called [DEPT] if that helps when advising on the expression.

I am using Access 2016. Thanks for any help you can give.

Rob :)
 
Use DCount. Something like

Code:
=DCount("*", "YourTableName","Dept = '" & Me.Dept & "' And Scheduled= #' & Date & '#")
 
When I enter the expression, I get a message 'The expression you entered has an invalid date value'

This is what I have entered:-
=DCount("*", "Tracker Main", "DEPT" = '" & Me.DEPT & "' And SCHEDULED= #' & Date & '#")
 
try
Code:
=DCount("*", "[Tracker Main]", "DEPT = '" & Me.DEPT & "' And SCHEDULED= #" & Date & "#")
 
Sorry - got my single & double quotes mixed up. Moke is correct
 
Thanks for your suggestion, now on my form the box shows:-

#Name?

After I put the expression in. Have I missed something here? Does it require the individual department name in it?

Sorry if I am being a bit slow here, coding is not my strong point with Access.

Rob :banghead:
 
You should already have selected the department using a control on your form e.g. combobox ?
If that's not called DEPT the you need to alter that part of the expression

Also if you are using a number ID field instead of department name, you need to update and remove the SINGLE quotes
 
I think I am going to have to give up on this idea, I have a feeling I am using the box in the wrong way having thought about your answer.

My thanks to you and Moke for your help with this.

I need to learn a little more before trying to leap ahead like this.

Kind regards,
Rob.

:)
 

Users who are viewing this thread

Back
Top Bottom