Expression Builder Query

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
767
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,

I am trying to get a "Textbox" to give a total if the "assigned to" = "M" and Status = "Pended" as per below.

=[Data]![Assigned To]="M" And [Data]![Status]="Pended"

I am getting an error as #Name?.

I am unsure of where i am going wrong or is there an easier way to do this?

Thanks
Gav
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
What is assigned to and pended? Are they also text boxes? What are you trying to total? Try to give us more detail about the form, the data and what exactly you want to do. We don't know anything about your database and it isn't very clear what you are trying to accomplish.
 
Upvote 0
What do you have set under the text box Properties, Control Source?


It looks like you need an IIf and condition(s) in the expression also.
 
Last edited:
Upvote 0
Ok, I will give it a go as best i can.
"Assigned to" is the header to the column that holds the persons name i want to count in the database
"Status" is the header to the column that holds the status of the record (Pending / Closed / Open)

I want to count how many records have the name in the Assigned to and Pended or Open in the Status column.

I have a textbox on my report with the agent name next to and would like to be able to show the number next to it.
In the text box proerties i have

=[Assigned To]="Mark Taylor" And [Data]![Status]="Pended"
**Data is the table the info is in
as the contol source.

Idealy I would like to be able to show on my report:-

Gavin Mazza 10 open

I hope this makes sense.

Thanks
Gav
 
Upvote 0
How do these work as i was trying to read up on it and didnt really understand it
 
Upvote 0
Perhaps.

DCount("[NameField]", "[Data]","[Assigned To]='M' And [Status]='Pended'")
 
Upvote 0
[NameField] is the field with name of the person you want to do the count for.

I have no idea what that field is called so I used [NameField], you'll need to replace it with the real name.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,820
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top