Seeing blank fields

O

OldManEd

In a report there is a field that has values in about half the records. I
want the report to show either a bottom line border or a border around the
whole field only when the field is blank. Can this be done? If so, how?

Ed
 
A

Armen Stein

In a report there is a field that has values in about half the records. I
want the report to show either a bottom line border or a border around the
whole field only when the field is blank. Can this be done? If so, how?

Ed


Try something like this in the ControlSource:

=IIF(IsNull(MyField), "_______________", MyField)

Make sure you change the name of the control on the report to
something other than your field name, so you don't get a circular
reference. Maybe something like txtMyField_UnderlineIfNull.

This assumes your fields are actual Null when you say "blank".

To have underlines whether your field is Null or Zero Length String,
you can use this instead:

IIF(MyField & "" = "", "_______________", MyField)

This is a cheap and easy way, but you need to set the correct number
of underline characters so it looks right.

A bit more difficult way is to set border properties for each empty
field in code in the On Format event of the section.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
E

Evi

OldManEd said:
In a report there is a field that has values in about half the records. I
want the report to show either a bottom line border or a border around the
whole field only when the field is blank. Can this be done? If so, how?

Ed

Let's say your field is called ItemComment
Paste this into the OnFormat Event of the section of the report that
contains your field.


If IsNull(Me.ItemComment) Then
Me.ItemComment.BorderStyle = 1
Else
Me.ItemComment.BorderStyle = 0
End If

Evi
 
O

OldManEd

Evi,
Thank you. This almost worked. Instead of a single border at bottom it added
a border on all four sides.

Is there a specific border property number for the bottom border?
Ed
 
O

OldManEd

Armen,
I tried Evi's way first but it didn't give a single border; instead it
produced a border on all four sides.

You said, "..difficult....is to set border properties for each field...."
What border property sets the bottom border?

Ed
 
J

John Spencer

Access Controls have a border all the way around or not all. You can't set
just one side.

What you can do is draw a line along the bottom of the control and set it's
visible property to true or false

If IsNull(Me.ItemComment) Then
Me.SomeLine.Visible = True
Else
Me.SomeLine.Visible = False
End If

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
E

Evi

OldManEd said:
Evi,
Thank you. This almost worked. Instead of a single border at bottom it added
a border on all four sides.

Is there a specific border property number for the bottom border?
Ed


There isn't a BottomBorder attribute in my Version of Access (2000).
If you want a 'bottom border' then put an line in your report (let's Name
it lnNullValue) under the control and use a similar code as the one below
but this time have

If IsNull(Me.ItemComment) Then
Me.lnNullValue.Visible = True
Else
Me.lnNullValue.Visible = False
End If

Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top