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

If field is Null how do i not display it? 1

Status
Not open for further replies.

paul123456

Technical User
Apr 29, 2002
518
US
I am running a report and i would like one of my field (VD) not to be diplayed if it is null? would i run it on open or on no data? Thanks, PAUL

 
If you want to suppress the entire detail line from appearing, put code like this in your detail section's On Format event:
Code:
If IsNull([VD]) Then
   Cancel = True
End If
 
You can also use an IIf statement in the control source property of the field on the report like this:

=IIf(IsNull([VP]),"", [VP])
 
I'm trying to do a similar thing.
But as well as not showing the field with the null value, I would like the fields below to shift up by level, so as not to leave an empty space.

Is this possible ??
 
jamespeters01,

You can do this if and only if you have no other controls on the same line and the control canshrink property is set to yes and the details section canshrink property is set to yes. -------------------------------------
Only two things are infinite, the
universe and human stupidity, and
I'm not sure about the former.
(Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: mstrmage@tampabay.rr.com
 
If I remember correctly, that is it....set the canshrink properties of the control in question and the details section and make sure the control does no touch any other control and is on a line by itself.... -------------------------------------
Only two things are infinite, the
universe and human stupidity, and
I'm not sure about the former.
(Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: mstrmage@tampabay.rr.com
 
If the goal is to not print a detail line when a specified field is null, then my option above will do the job. It's simple and you don't have to deal with setting properties for other controls or sections......
 
I think we are on different tracks. If for example I have 4 address fields. [Add1] has a record in it, as has [Add2], [Add3] is blank and [Add4] has a record in it. I would like to move the contents of [Add4] upto where [Add3] usually is. Thus not leaving a space between 3 and 4.
can this be done ??
 
Yes, that is different.

Look in Access help for the Trim function. If the controls are stacked vertically, and they all have a control source with this function, it will work. This is what the Label Wizard does.
Code:
=Trim([Add1])
=Trim([Add2])
...etc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top