报告:如果空的话如何隐藏字段? [英] Report: How to hide field if empty?

查看:73
本文介绍了报告:如果空的话如何隐藏字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在报告中,我有客户地址,地址1,地址2,地址3的字段。很少有人使用所有3个字段。我正在寻找一些代码来说......如果该字段为空,则不打印...即。在向我展示城市/州/邮编之前,不要留空。我怎么能这样做?

In a report, I have fields for customer''s address, Address 1, Address 2, Address 3. Very few people use all 3 fields. I am looking for some code to say..."if the field is null, don''t print...ie. don''t leave a blank line before you show me the city/state/zip. How can I do this?

推荐答案



报告中最简单的方法(不使用代码)是设置Address2和Address3的控件高度为零,但其属性Can Grow设置为Yes。


这不完美,因为行之间仍有累积的空间这将推动城市/州/拉下页面一点点,但这不应该是坏的,并且是一个很大的差距的改进。


S7
Hi
The simplest way to do this (without using code) in a Report is to set the heights of the controls for Address2 and Address3 to zero but have their property ''Can Grow'' set to Yes.

This is not perfect because there are still the accumulated spaces between the lines that will push city/state/zip down the page a little but this should not be bad and is an improvement on having a big gap.

S7


嗨agian,

我上一篇文章的替代方法是将三个地址行连贯起来。
Hi agian,
The alternative to my last post is to concatonate the three address lines thus.
展开 | 选择 | Wrap | 行号


@ S7。

VBA中有两个预定义值 Chr(13)& Chr(10) - vbCrLf vbNewLine 。要么替换代码中的两个( vbCr & vbLf 也可以单独使用)。


此外,你您可以查看使用&""和+在WHERE子句中处理Null结果字符串表达式。以下是他们可以做什么的说明:
@S7.
There are two predefined values in VBA for Chr(13) & Chr(10) - vbCrLf and vbNewLine. Either will replace the two in your code (vbCr & vbLf are also available for each individually).

Furthermore, you may like to check out Using "&" and "+" in WHERE Clause for handling Null-resulting string expressions. Here''s an illustration of what they can do :
展开 | 选择 | Wrap | 行号


这篇关于报告:如果空的话如何隐藏字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆