访问报告:当字段为空时隐藏字段和标签 [英] Access Report: Hiding field and Label when field is null

查看:63
本文介绍了访问报告:当字段为空时隐藏字段和标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:


在Access 2003上:我有一个表格形式,相关字段旁边有标签。当相关字段为空时,我希望它们都消失。 (Can Shrink将为该字段执行此操作,但标签仍然存在,因此报告不会缩小。)


任何想法如何使标签缩小?


谢谢,

Hi all:

On Access 2003: I have a tabular form with labels next to the associated fields. I''d like them both to dissappear when the associated field is null. ("Can Shrink" will do this for the field, but the label is still there, so the report does not shrink.)

Any ideas how I can make the label shrink too?

Thanks,

推荐答案

只需将标签更改为没有背景颜色的文本框,并设置条件格式,以便如果值为null(或[control] =""),则文本与背景颜色相同。您将需要锁定和禁用文本框,以便在不应该看到文本时不能选择该文本。
Simply change the label to a text box with no backcolor, and set conditional formatting so that if the value is null ( or [control] = "" ), the text is the same color as the background. You will want to lock and disable the text box so the text can''t be selected when it is not supposed to be visible.


谢谢。


实际上,我找到了一个不同的答案:我将标签更改为文本框并将控制源设置为iif(isnull([相关控制]),null,标题标题 )。然后我将标签的Can Shrink属性和与控件相关的属性设置为Yes。
Thanks.

Actually, I found a different answer: I changed the label to a text box and set the control source to iif(isnull([related control]),null,"Label Title"). Then I set the Can Shrink properties for the label and the related to control to Yes.


感谢您分享您的解决方案。这可能是一个更好的主意,因为我经历了条件格式化的缓慢更新。
Thank you for sharing your solution. That''s probably a much better idea, since I''ve experienced slow updating with conditional formatting.


这篇关于访问报告:当字段为空时隐藏字段和标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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