奇怪的报告错误消息 - 控件必须具有焦点 [英] Strange report error message - control must have focus

查看:61
本文介绍了奇怪的报告错误消息 - 控件必须具有焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份报告,打印父表和两个孩子

表(Contract和Kosten)的数据。因为它有点长,所以我根据存档中找到的方法来抑制一些通常为空的字段,这些字段为

这个组:允许在字段上收缩本身和以下

代码在详细信息部分中取消标签:


If(Me!InpassingWerkproces.Text ="")然后

Me!InpassingWerkproces_Bijschrift.Visible = False

Else

Me!InpassingWerkproces_Bijschrift.Visible = True

结束如果


被抑制的字段出现在所有三个记录中。


当同时存在Contract和Kosten记录时,这样可以正常工作。如果

没有Kosten记录,这可以正常工作。但是当没有合同

记录时,我收到一条错误消息(翻译自荷兰语)你只能

指的是控件的属性或方法,如果控件有

焦点。在调试时,所抱怨的代码是上面标签抑制代码的第一个实例的'if'行。如果我评论

,它会抱怨下一个实例。


我在处理合同和

Kosten记录。


有谁可以建议我应该在哪里寻找?

(Access 2000,荷兰语版,Windows XP专业版)


========


附属问题(更不重要):我在
$ b中找到的例子$ b存档全部仅提供上述IF语句的前半部分。但是

我发现''Visible''属性的值从一个

详细记录保存到下一个:一旦我将它设置为False,它仍然是假的对于

所有后续记录。 Access的行为是否改变了一些

点?


-

Stephen Poley

解决方案

On Sun,2005年10月30日07:44:13 +0100,Stephen Poley< sb ****************** @ xs4all.nl>写道:

我有一个报告,打印父表和两个子表
表(Contract和Kosten)的数据。因为它有点长,所以我根据这个组的存档中找到的方法来抑制一些通常为空的字段:允许对字段本身及以下内容进行缩小
详细信息部分中的代码用于抑制标签:

If(Me!InpassingWerkproces.Text ="")然后
我!InpassingWerkproces_Bijschrift.Visible = False
其他
我!InpassingWerkproces_Bijschrift.Visible = True
结束如果

所有三个记录都会出现被抑制的字段。

当合同和Kosten记录时工作良好。如果
没有Kosten记录,这可以正常工作。但是当没有合同
记录时,我收到一条错误消息(翻译自荷兰语)如果控件具有
焦点,则您只能参考控件的属性或方法 ;。在调试时,所抱怨的代码是上面标签抑制代码的第一个实例的if行。如果我评论
,它会抱怨下一个实例。

我在处理合同和Kosten记录的方式上看起来是徒劳的。

任何人都可以建议我应该在哪里看看?

(Access 2000,荷兰语版,Windows XP专业版)

========

附属问题(更不重要):我在
档案中找到的例子都只提供了上述IF语句的前半部分。但是
我发现''Visible''属性的值从一个
详细记录保存到下一个:一旦我将它设置为False,它对于
所有后续记录都保持为假。 Access的行为是否在某些方面发生了变化?



使用 -

如果(Me!InpassingWerkproces ="")

而不是

If(Me!InpassingWerkproces.Text ="")


Text属性仅在控件具有焦点,从未在报告中发生。


On Sun,2005年10月30日08:18:50 GMT,Wayne Gillespie

< be ***** @ NOhotmailSPAM.com.au>写道:

On Sun,2005年10月30日07:44:13 +0100,Stephen Poley< sb ***************** *@xs4all.nl>写道:

我有一个报告,打印父表和两个子表
表(Contract和Kosten)的数据。因为它有点长,我会压制一些通常为空的字段:
< snip>如果(Me!InpassingWerkproces.Text ="")那么
我!InpassingWerkproces_Bijschrift.Visible = False
否则
我!InpassingWerkproces_Bijschrift.Visible = True
结束如果
抑制字段出现在所有三个记录中。

如果同时存在Contract和Kosten记录,则此工作正常。如果
没有Kosten记录,这可以正常工作。但是当没有合同
记录时,我收到一条错误消息(翻译自荷兰语)如果控件具有
焦点,则您只能参考控件的属性或方法 ;。


使用 -
如果(Me!InpassingWerkproces ="")
而不是
If(Me!InpassingWerkproces.Text ="")

Text属性仅在控件具有焦点时才可用,这在报告中从不发生。



如果是这样的话,我的表现如何?当两个孩子都有b $ b b记录时,报告工作正常吗?


-

Stephen Poley


1。尝试使用.Value属性而不是.Text。

或者只使用

If(Me!InpassingWerkproces ="")然后


2.你所观察到的行为(更改详细记录的格式

保持不变直到再次更改)已经存在,只要我一直在工作

with Access(回到2.0)。


HTH


" Stephen Poley" < SB ****************** @ xs4all.nl>在消息中写道

news:e2 ******************************** @ 4ax.com ...

我有一个报告,它打印父表和两个子表
表(Contract和Kosten)的数据。因为它有点长,所以我根据这个组的存档中找到的方法来抑制一些通常为空的字段:允许对字段本身及以下内容进行缩小
详细信息部分中的代码用于抑制标签:

If(Me!InpassingWerkproces.Text ="")然后
我!InpassingWerkproces_Bijschrift.Visible = False
其他
我!InpassingWerkproces_Bijschrift.Visible = True
结束如果

所有三个记录都会出现被抑制的字段。

当合同和Kosten记录时工作良好。如果
没有Kosten记录,这可以正常工作。但是当没有合同
记录时,我收到一条错误消息(翻译自荷兰语)如果控件具有
焦点,则您只能参考控件的属性或方法 ;。在调试时,所抱怨的代码是上面标签抑制代码的第一个实例的if行。如果我评论
,它会抱怨下一个实例。

我在处理合同和Kosten记录的方式上看起来是徒劳的。

任何人都可以建议我应该在哪里看看?

(Access 2000,荷兰语版,Windows XP专业版)

========

附属问题(更不重要):我在
档案中找到的例子都只提供了上述IF语句的前半部分。但是
我发现''Visible''属性的值从一个
详细记录保存到下一个:一旦我将它设置为False,它对于
所有后续记录都保持为假。 Access的行为是否有所改变?

-
Stephen Poley



I have a report which prints data from a parent table and two child
tables (Contract and Kosten). Because it is a bit long, I suppress some
fields which are often empty, based on methods found in the archive for
this group: allowing can-shrink on the field itself and the following
code in the details section to suppress the label:

If (Me!InpassingWerkproces.Text = "") Then
Me!InpassingWerkproces_Bijschrift.Visible = False
Else
Me!InpassingWerkproces_Bijschrift.Visible = True
End If

The suppressed fields occur in all three records.

When there is both a Contract and Kosten record this works fine. If
there is no Kosten record this works fine. But when there is no Contract
record I get an error message (translated from the Dutch) "you can only
refer to a property or method of a control if the control has the
focus". On debugging, the code complained about is the ''if'' line of the
first instance of the label-suppression code above. If I comment that
out, it complains about the next instance.

I have looked in vain for differences in the ways I handle Contract and
Kosten records.

Can anyone suggest where I should be looking?
(Access 2000, Dutch version, Windows XP Pro)

========

Subsidiary question (much less important): the examples I found in the
archive all provided only the first half of the above IF statement. But
I found that the value of the ''Visible'' property was maintained from one
detail record to the next: once I set it to False, it remained False for
all subsequent records. Has the behaviour of Access changed at some
point?

--
Stephen Poley

解决方案

On Sun, 30 Oct 2005 07:44:13 +0100, Stephen Poley <sb******************@xs4all.nl> wrote:

I have a report which prints data from a parent table and two child
tables (Contract and Kosten). Because it is a bit long, I suppress some
fields which are often empty, based on methods found in the archive for
this group: allowing can-shrink on the field itself and the following
code in the details section to suppress the label:

If (Me!InpassingWerkproces.Text = "") Then
Me!InpassingWerkproces_Bijschrift.Visible = False
Else
Me!InpassingWerkproces_Bijschrift.Visible = True
End If

The suppressed fields occur in all three records.

When there is both a Contract and Kosten record this works fine. If
there is no Kosten record this works fine. But when there is no Contract
record I get an error message (translated from the Dutch) "you can only
refer to a property or method of a control if the control has the
focus". On debugging, the code complained about is the ''if'' line of the
first instance of the label-suppression code above. If I comment that
out, it complains about the next instance.

I have looked in vain for differences in the ways I handle Contract and
Kosten records.

Can anyone suggest where I should be looking?
(Access 2000, Dutch version, Windows XP Pro)

========

Subsidiary question (much less important): the examples I found in the
archive all provided only the first half of the above IF statement. But
I found that the value of the ''Visible'' property was maintained from one
detail record to the next: once I set it to False, it remained False for
all subsequent records. Has the behaviour of Access changed at some
point?


Use -
If (Me!InpassingWerkproces= "")
instead of
If (Me!InpassingWerkproces.Text = "")

The Text property is only available if the control has focus, which never happens in a report.


On Sun, 30 Oct 2005 08:18:50 GMT, Wayne Gillespie
<be*****@NOhotmailSPAM.com.au> wrote:

On Sun, 30 Oct 2005 07:44:13 +0100, Stephen Poley <sb******************@xs4all.nl> wrote:

I have a report which prints data from a parent table and two child
tables (Contract and Kosten). Because it is a bit long, I suppress some
fields which are often empty: <snip> If (Me!InpassingWerkproces.Text = "") Then
Me!InpassingWerkproces_Bijschrift.Visible = False
Else
Me!InpassingWerkproces_Bijschrift.Visible = True
End If

The suppressed fields occur in all three records.

When there is both a Contract and Kosten record this works fine. If
there is no Kosten record this works fine. But when there is no Contract
record I get an error message (translated from the Dutch) "you can only
refer to a property or method of a control if the control has the
focus".

Use -
If (Me!InpassingWerkproces= "")
instead of
If (Me!InpassingWerkproces.Text = "")

The Text property is only available if the control has focus, which never happens in a report.


If that is the case, how is it that my report works fine when both child
records are present?

--
Stephen Poley


1. Try using the .Value property instead of .Text.
Or just use
If (Me!InpassingWerkproces = "") Then

2. The behavior you''ve observed (changing the formatting of a detail record
remains until changed again) has been there as long as I''ve been working
with Access (back to 2.0).

HTH

"Stephen Poley" <sb******************@xs4all.nl> wrote in message
news:e2********************************@4ax.com...

I have a report which prints data from a parent table and two child
tables (Contract and Kosten). Because it is a bit long, I suppress some
fields which are often empty, based on methods found in the archive for
this group: allowing can-shrink on the field itself and the following
code in the details section to suppress the label:

If (Me!InpassingWerkproces.Text = "") Then
Me!InpassingWerkproces_Bijschrift.Visible = False
Else
Me!InpassingWerkproces_Bijschrift.Visible = True
End If

The suppressed fields occur in all three records.

When there is both a Contract and Kosten record this works fine. If
there is no Kosten record this works fine. But when there is no Contract
record I get an error message (translated from the Dutch) "you can only
refer to a property or method of a control if the control has the
focus". On debugging, the code complained about is the ''if'' line of the
first instance of the label-suppression code above. If I comment that
out, it complains about the next instance.

I have looked in vain for differences in the ways I handle Contract and
Kosten records.

Can anyone suggest where I should be looking?
(Access 2000, Dutch version, Windows XP Pro)

========

Subsidiary question (much less important): the examples I found in the
archive all provided only the first half of the above IF statement. But
I found that the value of the ''Visible'' property was maintained from one
detail record to the next: once I set it to False, it remained False for
all subsequent records. Has the behaviour of Access changed at some
point?

--
Stephen Poley



这篇关于奇怪的报告错误消息 - 控件必须具有焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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