当value = 0时,隐藏报表中的整个列 [英] Hiding Entire Columns in Report when value = 0

查看:69
本文介绍了当value = 0时,隐藏报表中的整个列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我一直在搜索这几天。当该列中的所有值都是0时,我需要在报告中隐藏一列。或空白。

此外,如果列中包含值的列可以移动,使得表之间没有任何空格,那将是首选。


我是第一件事尝试过:


在文本框的控制源中,我输入了:

= IIf([WOOD_SF] =" 0",WOOD_SF.Visible =" false",WOOD_SF.Visible =" true")

= IIf([WOOD_SF] =" 0",WOOD_SF.hidden =" true",WOOD_SF.hidden =" ; fals e)

我收到了输入参数值即使字段中的值大于0,它也会隐藏整列。


在visual Basic Editor中我尝试过:

1.

/ CODE /私人子报告_打开(取消为整数)

如果LenWOOD_SF> 0然后

WOOD_SF.Visible =真

否则

WOOD_SF.Visible = False

结束如果

结束子/代码/

2.

/CODE/Me !WOOD_SF.Visible=(Me!WOOD_SF)/CODE/


我是Visual Basic的新手,所以我更喜欢最简单的方法。使用MS ACCESS 2003,WindowsXP如果有帮助的话。


感谢您提供的任何帮助。

Hi all,

I have been searching for a couple days on this. I need to hide a column in the reports when all values within that column are "0" or blank.
Additionally if the columns that have values in them can shift so that the table does not have any spaces in between, that would be preferrable.

Things I have tried:

In the Control Source of the Text box I have input:
=IIf([WOOD_SF]="0",WOOD_SF.Visible="false",WOOD_SF.Visible="true ")
=IIf([WOOD_SF]="0",WOOD_SF.hidden="true",WOOD_SF.hidden="fals e")
I received either an "enter a parameter value" message or it would hide the whole column even if there was a value greater than 0 in on of the fields.

In the visual Basic Editor I have tried:
1.
/CODE/Private Sub Report_Open(Cancel As Integer)
If LenWOOD_SF > 0 Then
WOOD_SF.Visible = True
Else
WOOD_SF.Visible = False
End If
End Sub/CODE/
2.
/CODE/Me!WOOD_SF.Visible=(Me!WOOD_SF)/CODE/

I am kind of new to Visual Basic so I would prefer the easiest way possible. Working off MS ACCESS 2003, WindowsXP if that helps.

Thanks for any help you can provide.

推荐答案


您好所有,


我一直在搜索这几天。当该列中的所有值都是0时,我需要在报告中隐藏一列。或空白。

此外,如果列中包含值的列可以移动,使得表之间没有任何空格,那将是首选。


我是第一件事尝试过:


在文本框的控制源中,我输入了:

= IIf([WOOD_SF] =" 0",WOOD_SF.Visible = QUOT假QUOT;,WOOD_SF.Visible = QUOT;真")

= IIF([WOOD_SF] =" 0",WOOD_SF.hidden = QUOT;真",WOOD_SF.hidden = QUOT ; fals e)

我收到了输入参数值即使字段中的值大于0,它也会隐藏整列。


在visual Basic Editor中我尝试过:

1.

/ CODE /私人子报告_打开(取消为整数)

如果LenWOOD_SF> 0然后

WOOD_SF.Visible =真

否则

WOOD_SF.Visible = False

结束如果

结束子/代码/

2.

/CODE/Me !WOOD_SF.Visible=(Me!WOOD_SF)/CODE/


我是Visual Basic的新手,所以我更喜欢最简单的方法。使用MS ACCESS 2003,WindowsXP如果有帮助的话。


感谢您提供的任何帮助。
Hi all,

I have been searching for a couple days on this. I need to hide a column in the reports when all values within that column are "0" or blank.
Additionally if the columns that have values in them can shift so that the table does not have any spaces in between, that would be preferrable.

Things I have tried:

In the Control Source of the Text box I have input:
=IIf([WOOD_SF]="0",WOOD_SF.Visible="false",WOOD_SF.Visible="true ")
=IIf([WOOD_SF]="0",WOOD_SF.hidden="true",WOOD_SF.hidden="fals e")
I received either an "enter a parameter value" message or it would hide the whole column even if there was a value greater than 0 in on of the fields.

In the visual Basic Editor I have tried:
1.
/CODE/Private Sub Report_Open(Cancel As Integer)
If LenWOOD_SF > 0 Then
WOOD_SF.Visible = True
Else
WOOD_SF.Visible = False
End If
End Sub/CODE/
2.
/CODE/Me!WOOD_SF.Visible=(Me!WOOD_SF)/CODE/

I am kind of new to Visual Basic so I would prefer the easiest way possible. Working off MS ACCESS 2003, WindowsXP if that helps.

Thanks for any help you can provide.



完成所需操作的最简单方法是将约束放在作为报告记录源的查询中。转到查询网格中具有零/空余额的列的条件行,并放置以下表达式:

<> 0或<> nz([yourColumnName],0 )


用实际列名替换表达式中的yourColumnName

The easiest way to accomplish what you want is to put the constraint in the query that is the record source for the report. Go to the criteria row of the column in the query grid that has the zero/null balances and put the following expression:
<>0 Or <>nz([yourColumnName],0)

Replace yourColumnName in the expression with the actual column name



最简单的方法完成你想要的是将约束放在作为报告记录源的查询中。转到查询网格中具有零/空余额的列的条件行,并放置以下表达式:

<> 0或<> nz([yourColumnName],0 )


用实际的列名替换表达式中的yourColumnName
The easiest way to accomplish what you want is to put the constraint in the query that is the record source for the report. Go to the criteria row of the column in the query grid that has the zero/null balances and put the following expression:
<>0 Or <>nz([yourColumnName],0)

Replace yourColumnName in the expression with the actual column name



那对我来说没有用..它取出了我报告中的所有价值观。包括我想要显示的列值。我做错了什么?


That didnt work out for me.. It took out all my values from my report. In including the column values that I want to show. What am I doing wrong?



那对我来说没有用..它从我的报告中取出了我的所有价值观。包括我想要显示的列值。我究竟做错了什么?
That didnt work out for me.. It took out all my values from my report. In including the column values that I want to show. What am I doing wrong?



我需要更多信息。请从查询的sql视图发布sql。

I need more info. Please post the sql from the sql view of your query.


这篇关于当value = 0时,隐藏报表中的整个列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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