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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide field with no data

Status
Not open for further replies.

bethabernathy

Programmer
Jul 13, 2001
254
MX
Hi -

I am trying to write a report that is going to be an envelope.

I have the following fields:
name, address1, address2, city, state, zip

It is all working pretty well, but I want to find a way so that if there is no data in the "address2" field the record doesn't show up and create a blank space in the report.

This is what I get if there is no data in address2:

Beth Abernathy
P.O. Box 4395

San Francisco, CA 98943

Sometimes the "address2" field is needed, so I have to leave it in.

Any suggestions.

Thanks, Beth beth@integratedresourcemgmt.com
 
How about this.

If "address2" is null then display "city"

If "address2" is not null then display "address2"

I have gotten this far:

=IIf(IsNull([address2]),"",[Expr2])

But it isn't displaying "address2" if there is data in the field.

Any suggestions?

Thanks, Beth beth@integratedresourcemgmt.com
 
Hi Cosmo - Great to hear from you. I tried it with that syntax and I am getting an error. I put it in the "address2" text box. I wonder if I am missing something?

Thanks for responding. Beth beth@integratedresourcemgmt.com
 
Hi There: This is what I am using now:

=IIf(IsNull([address2]),[Expr2],[address2])

I changed the name of the text box to "txt1" and that eliminated the error message. But.. it still is leaving "address2" blank.

I must be missing something.

Beth beth@integratedresourcemgmt.com
 
Back Again -

Well I figured out some of it. The field "address2" is not null. It contains blank spaces. The data is linked via ODBC and is strange. So, I need to figure out the syntax for if

"address2" is " " then "expr2" then "address2"

I am at this:

=IIf([address2]," ",[Expr2])

I can't seem to get the last "address2" in the syntax properly.

Any help is appreciated.

Thanks,
Beth beth@integratedresourcemgmt.com
 
I am clearly insane. This is what is working:

txt1 =IIf([address2]=" ",[Expr2],[address2])
text5 =IIf([txt1]=[Expr2]," ")

So now all the lines in the little envelope are perfect.

What a nightmare.

Beth beth@integratedresourcemgmt.com
 
Sorry one more try:

txt1 =IIf([address2]=" ",[Expr2],[address2])
text5 =IIf([txt1]=[address2],[Expr2])

That is what is working.

beth@integratedresourcemgmt.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top