Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIf Statement Help In A Report

Status
Not open for further replies.

jamason07

IS-IT--Management
Aug 28, 2003
46
US
Good Afternoon All,

I have an unbound field in a report and the report is tied to a query. I want the unbound field to populate with the contents of the first field [field1] but if that field is null...then I want it to populate with the contents of [field2]. I am using the following statement in the control source:

=IIf(IsNull([Field1]), "", [Field2])

but I am getting an Error# message.

Suggestions? Thanks in advance!

JAM
 
should read:

=IIf(IsNull([Field1]), [Field2], [Field1])

outside of that...check all names and makes sure they are correct....that should work.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Try:
=Nz([Field1],[Field2])

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top