If Statement in report

  • Thread starter Thread starter Aurora
  • Start date Start date
A

Aurora

I am using Access 2000.

I have a database in which several people (foremen,
engineers) enter data. In my report, I want the foreman's
signature if he alone worked on the report but if the
engineer worked/changed the report, I then want his
signature on the final report. I wrote the following "if"
statement, but it does not appear to be working. I am
trying to say "if the engineering signature is empty, give
me the IASupervisor's signature, if the engineering
signature is not empty, then give me the engineering
signature."

RptSign: IIf([Eng-Sign]=Null,[IASupv-Sign],[Eng-Sign])

Does anyone have any suggestions???????????
 
Aurora said:
I am using Access 2000.

I have a database in which several people (foremen,
engineers) enter data. In my report, I want the foreman's
signature if he alone worked on the report but if the
engineer worked/changed the report, I then want his
signature on the final report. I wrote the following "if"
statement, but it does not appear to be working. I am
trying to say "if the engineering signature is empty, give
me the IASupervisor's signature, if the engineering
signature is not empty, then give me the engineering
signature."

RptSign: IIf([Eng-Sign]=Null,[IASupv-Sign],[Eng-Sign])

Does anyone have any suggestions???????????

Nothing is ever = Null or <> Null. You have to use Is Null and Is Not Null in SQL
and the IsNull() function in VBA. In your case the Nz() function is actually a
little cleaner.

RptSign: Nz([Eng-Sign],[IASupv-Sign])
 
Back
Top