To simplify this I created another form with just 3 text boxes. "txt
CompanyName", "txtContactName"' and a third text box to display the Company
Name or the Contact Name. The code(in the third box) still does't work.
=NZ([txtCompanyName],[txtContactName])
I finally used a fourth text box and tried this code:
=IIF(IsNull([txtCompanyName],[txtContactName],[txtCompanyName[). That worked.
I am curious why the NZ code didn't work. Here is the SQL:SELECT
Customers.CompanyName, [ContactFirstName] & " " & [ContactLastName] AS
ContactName
FROM Customers;
Thanks
John W. Vinson said:
What is the Recordsource of your report? Could you post the SQL view? Is there
a field in that recordsource for ContactName, and/or is there a control on the
form named ContactName? If you have both a field and a textbox, that could be
the problem: try changing the name of the textbox to txtContactName, for
example, so it's unambiguous.