如果字段为空的代码,不打印? [英] Code for if a field is null, don't print?

查看:106
本文介绍了如果字段为空的代码,不打印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我希望我最终能回答一个简单的问题。 :-)

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

提前致谢!!!!!!!!!!

Ok everyone, I hope I finally have a question with a simple answer. :-)
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?
Thanks in advance!!!!!!!!!!

推荐答案

@DanicaDear

不是光年丹妮卡。
@DanicaDear


如何格式化报告?哪些控件相对于其他控件?请记住包含Label控件以及TextBox。


一种可行的技术(取决于问题的答案)是使用多行的TextBox控件和 .CanGrow / .CanShrink 属性。否则我只能考虑使用一些相当复杂的VBA编码。
@DanicaDear
Not by a Light-Year Danica.
@DanicaDear
How do you have the report formatted? Which controls are where relative to the others? Remember to include the Label controls as well as the TextBoxes.

One technique that may work (depends on answer to questions) is to use a TextBox control of multiple lines and the .CanGrow/.CanShrink properties. Otherwise I can only think of using some fairly intricate VBA coding.


LOL。我想我认为会有一些神奇的VBA /表达。


我不确定这是值得我的还是你的时间。这将是一个钟声和哨声。正如我们在美国所说的那样。老实说,我想学习错综复杂的VBA编码。但另一方面,我意识到我无法在我的第一个数据库上编写世界上最好的软件包。你可能根本没有留下深刻印象,但我对目前为止所做的事情印象深刻,因为仅仅3周前我从未点击过Access中的按钮。无论如何......回到这里的问题......你可能已经从另一个帖子上传了我的数据库,所以随意使用它。在报告rptSTICKS_NOT_RETURNED中,您将在两个结果中找到此地址问题。当提示[自上次装运以来的天数]参数输入时,使用60。再次感谢您的耐心和时间。
LOL. I guess I thought there would be some magic VBA/expression.

I am not sure that this is worth my or your time. It would be a "bell and whistle" as we call it in the USA. I''ll be honest I would like to learn "intricate VBA coding" but on the other hand I realize I am not going to be able to write the world''s fanciest software package on my very first DB. You probably aren''t impressed at all but I''m impressed with what I have done so far, since just 3 weeks ago I had never clicked a button in Access. Anyway...back to the issue here...you have probably uploaded my DB from another post so feel free to use that. In the report rptSTICKS_NOT_RETURNED, you will find this address issue on two of the results. When prompted for [Days since last shipment] parameter input, use "60". Thanks once again for patience and time.


您好Dancia

我看了这个,因为我正在检查您的其他问题。

嗯,是的,这可能与VBA有关,但绝不能实现你的要求。

这将涉及检查每个地址字段中的字符长度

并调整文本框控件的大小和位置。


我认为你最好将查询中涉及1或2个字段的所有字段连接起来基于,然后重新设计您的报告以适应。


或者可能在查询中将所有3个地址字段连接成1

或任意数量的其他组合(在查询)
Hi Dancia
I took a look at this as I was checking out your other issue.
Hmmm, yes its possible with VBA but by no means trival to accomplish what you are asking.
It would involve checking the character length in each address field
and adjusting the size and position of the textbox controls.


I think you would be better off concattenating all of the fields involved into 1 or 2 fields in the query that the report is based off and then redesign your report to suit.

Or maybe concattenating all 3 address fields into 1 in the query
Or any number of other combinations (in the query)


这篇关于如果字段为空的代码,不打印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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