In Access how to set criteria for show field content or not

Anita Diamond 0 Reputation points
2026-06-27T18:01:59.6733333+00:00

In access: How to display a field's contents or the word "unavailable" based on another field with a yes/no structure. This is for a query that is being used for generating a report.

Microsoft 365 and Office | Access | Development
0 comments No comments

1 answer

Sort by: Oldest
  1. Duane Hookom 26,935 Reputation points Volunteer Moderator
    2026-06-27T18:09:11.3033333+00:00

    You can do this in the query or in the report. I would use the expression:

    IIf([AnotherFieldNameHere], [FieldName], "unavailable")

    This would mean if [AnotherFieldNameHere] is true, display the contents of [FieldName]. If it is false, display "unavailable".

    This could be a new column in a query or in a text box control source following an equal sign:

    =IIf([AnotherFieldNameHere], [FieldName], "unavailable")

    The name of the text box control in your report can't have the same name as a field in the report's record source if your use the "=..."

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.