Calculated Field on Report

K

Karen

Using Access 2003
I created a "Find Unmatched Query Record" Query and then
created a report based on that query. When there are NO
unmatched records, (instead of the record being blank) I
want a field to show a message - "No Unmatched Records."
If there are any unmatched records, I want a calculated
field to show the total number of unmatched records. How
can I set this up?

Thank you, Karen
 
P

PC Datasheet

Add an unbound textbox to your report and put the following expression in
its control source property:
=IIF(DCount("*","NameOfYourQuery") = 0,"No Unmatched Records", _
"The Total Number Of Unmatched Records = " &
DCount("*","NameOfYourQuery"))
 
K

Karen

Thank you - It worked great!
-----Original Message-----
Add an unbound textbox to your report and put the following expression in
its control source property:
=IIF(DCount("*","NameOfYourQuery") = 0,"No Unmatched Records", _
"The Total Number Of Unmatched Records = " &
DCount("*","NameOfYourQuery"))

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com







.
 
M

Marshall Barton

Karen said:
Using Access 2003
I created a "Find Unmatched Query Record" Query and then
created a report based on that query. When there are NO
unmatched records, (instead of the record being blank) I
want a field to show a message - "No Unmatched Records."
If there are any unmatched records, I want a calculated
field to show the total number of unmatched records. How
can I set this up?


Another way is to have a text box with the expression:

=IIf(Report.HasData, Count(*), "No") & " Unmatched records"
 

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