Discussion Locked

Access 97 expression question

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

What's wrong with this report formula?

=IIf(IsNull(Adv Details![PriReg],Adv Details![Reg Name],Adv Details![PriReg])

I want the field PriReg to print if it contains something, if null, I want Reg Name to print. I originally tried this using "Renewal!" as part of the identifier, (Renewal is the query that controls the report). That gave me an error message, so I tried using "Adv Details!" because that is the table where both of the fields in question live. Now it won't accept it in the control source field at all.

Thanks for any help. If there is a better reference out there than the few syntax help files I found in Access, I'd love to hear about it.

4 replies

by mbarker734

Right off I can tell you are missing a parethesis.

=IIf(IsNull(Adv Details![PriReg]),Adv Details![Reg Name],Adv Details![PriReg])

I assume this expresion is used as the Control Source for a Text Box.

If both fields are contained in the source query for the report your line should read.

=IIf(IsNull([PriReg]),[Reg Name],[PriReg])

Hope this helps,

Mark

by mbarker734

The parethesis you are missing is the right side of the IsNull function just after [PriReg]

Good luck,

Mark

This discussion is closed to new replies.