报告+如果声明问题 [英] Reports + If Statement Problem

查看:78
本文介绍了报告+如果声明问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


请快速提问。


我有一份报告,提供与所有已处理工作相关的查询。查询中的一个文件是作业的当前状态。该工作可以是打开,关闭也可以是打开。或取消。


查询的记录显示在报告的详细信息部分。


现在我想将以下内容添加到格式事件中报告的详细信息部分,但它不起作用..我不断收到有关声明的错误(对属性的无效引用可见)。有什么建议?字段显示在表单上。状态字段也设置为不可见。我也尝试过这个报告的Open事件,而且也没有用。


如果Me.Status =取消然后

Me.lbl_cancelled.Application.Visible = True

ElseIf Me.Status =" Closed"然后

Me.lbl_cancelled.Application.Visible = False

结束如果


''取消的标签假设出现在如果作业被视为取消,则记录。


提前致谢。

Hi All,

Just a quick question please.

I have a report that feeds off a query relating to all processed jobs. One of the fileds in the query is the current status of the Job. The job can either be "open", "closed" or "cancelled".

The records of the query appear in the detail section of the report.

Now i wanted to add the following to the format event in the detail section of the report, but it doesn''t work.. I keep getting errors regarding the statement (invalid reference to the property visible). Any suggestions? The fields are present on the form. The status field is set to invisible as well. I have also tried this int he Open event for the report, and that didn''t work either.

If Me.Status = "Cancelled" Then
Me.lbl_cancelled.Application.Visible = True
ElseIf Me.Status = "Closed" Then
Me.lbl_cancelled.Application.Visible = False
End If

'' The label cancelled is suppose to appear on a record if the Job is considered cancelled.

Thanks in advance.

推荐答案

告诉我们错误发生的确切位置和确切的错误信息是什么,我们将看到我们能为您找到什么。
Tell us exactly where the error occurs and exactly what the error message is and we''ll see what we can find for you.


您好NeoPa,


所以当我放置if格式事件下的详细信息部分中的if语句,我得到错误运行时错误2455:您输入的espression对可见属性的引用无效。


当我将其放入报告的打开事件时,我收到错误"运行时错误2427:您输入了一个没有值的表达式。


我甚至尝试将代码修改为:


''放置在详细信息部分,在格式化事件下

如果Me.Status =已取消然后

Me.lbl_cancelled.Properties.Application.Visible = True

ElseIf Me.Status =" Closed"然后

Me.lbl_cancelled.Properties.Application.Visible = False

结束如果


似乎没什么用。


我只是想让取消的记录显示被取消的标签,而其余部分则不会显示。我现在已经将它的属性设置为隐形。


请指教。


问候
Hi NeoPa,

So when i place the if statement in the Detail section under the On Format event, i get the error " Run-time error 2455: You entered an espression that has an invalid reference to the property visible."

When i place it in the Open Event for the Report, I get the error " Run-time error 2427: You enetered an expression that has no value."

I have even tried modifying the code to:

''Placed in the Detail section, under the On Format Event

If Me.Status = "Cancelled" Then
Me.lbl_cancelled.Properties.Application.Visible = True
ElseIf Me.Status = "Closed" Then
Me.lbl_cancelled.Properties.Application.Visible = False
End If

Nothing seems to work.

I''m just trying to make the label called cancelled appear for the cancelled records, and not appear for the rest. I have set the property of it invisible for now.

Please advise.

Regards



嗨NeoPa,


因此当我将if语句放在On Format事件下的Detail部分时,我得到错误运行时错误2455:您输入的espression对可见属性的引用无效。


当我将其放入报告的打开事件时,我收到错误"运行时错误2427:您输入了一个没有值的表达式。


我甚至尝试将代码修改为:


''放置在详细信息部分,在格式化事件下

如果Me.Status =已取消然后

Me.lbl_cancelled.Properties.Application.Visible = True

ElseIf Me.Status =" Closed"然后

Me.lbl_cancelled.Properties.Application.Visible = False

结束如果


似乎没什么用。


我只是想让取消的记录显示被取消的标签,而其余部分则不会显示。我现在设置它的隐形属性。


请指教。


问候
Hi NeoPa,

So when i place the if statement in the Detail section under the On Format event, i get the error " Run-time error 2455: You entered an espression that has an invalid reference to the property visible."

When i place it in the Open Event for the Report, I get the error " Run-time error 2427: You enetered an expression that has no value."

I have even tried modifying the code to:

''Placed in the Detail section, under the On Format Event

If Me.Status = "Cancelled" Then
Me.lbl_cancelled.Properties.Application.Visible = True
ElseIf Me.Status = "Closed" Then
Me.lbl_cancelled.Properties.Application.Visible = False
End If

Nothing seems to work.

I''m just trying to make the label called cancelled appear for the cancelled records, and not appear for the rest. I have set the property of it invisible for now.

Please advise.

Regards



现在一切都有意义。

Now it all makes sense.

展开 | 选择 | Wrap | 行号


这篇关于报告+如果声明问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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