more about blank lines in reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

the other day james hatman asked:

"I was wondering if in the report, some objects might be able to remain
hidden if the field in the table or report is left null."
On the "on print" event of your detail add the code

if isnull(Me.field1) then
me.field2.visible=false
else
me.field2.visible=true
endif

note that i DID post a follow-up question, but i didn't mark it with a ?
mark... if that's even possible. plus, it went to the second page so i don't
know that anyone would ever see it. thus, i am re-posting here! :-)

now i'm looking to do something similar to james. i have a field
ContactName in my address label report. some records do not have the
ContactName field.

using this code i can make it so that the line does not print if there
is no information in the ContactName field. but what i REALLY want to do is
have the second line of my address label (for those addresses that have the
ContactName line) be

ATTN: {ContactName}

but again, just to clarify, i want addresses of those whose records do not
have a ContactName line to not have anything. i've tried a couple of things
and it seems either the "ATTN:" will print with a blank behind it or it will
never print at all, even in the records that have an entry in under
ContactName.
 
If a field value is null than nothing will display in the bound text box. If
you want to display "ATTN:" and the contact name, use a text box with a
control source of:
="ATTN: " + [ContactName]
Make sure the name of the text box is not also the name of a field. If the
ContactName is Null then the ATTN: will not display.
 
Back
Top