I am trying to make a Label Control Visible based on the value of a Textbox
in my Report's Open Procedure:
If txtSubTotals.Text = "No Data" Then
lblMessage.Visible = True
Else
lblMessage.Visisble = False
End if
The problem is I am receiving this error message:
"2185" You can't reference a property or method
for a control unless the control has focus.
I am a little confused because I am using a Label Control on my Report.
Could you please provide with the proper code to accomplish this task. I
tried looking for this error in the Knowledgebase (No Luck).

Signature
Thanx!
Tru - 22 Jan 2006 02:53 GMT
Got it! Used the OnFormat Property, Thanx anyway.

Signature
Thanx!
> I am trying to make a Label Control Visible based on the value of a Textbox
> in my Report's Open Procedure:
[quoted text clipped - 13 lines]
> Could you please provide with the proper code to accomplish this task. I
> tried looking for this error in the Knowledgebase (No Luck).
Marshall Barton - 22 Jan 2006 03:36 GMT
>I am trying to make a Label Control Visible based on the value of a Textbox
>in my Report's Open Procedure:
[quoted text clipped - 13 lines]
>Could you please provide with the proper code to accomplish this task. I
>tried looking for this error in the Knowledgebase (No Luck).
Your use of the Text property is causing the error. You
should use the Value property instead.
However, since you said you were doing this in the report's
Open event, that shouldn't work either, The Open event is
too early for the Value property of controls to be
available,
Perhaps I could make an alternative suggestion if you
explained what you're trying to accomplish in the report.

Signature
Marsh
MVP [MS Access]