A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referencing a Report's Control



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2006, 02:05 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Referencing a Report's Control

I am trying to make a Label Control Visible based on the value of a Textbox
in my Report's Open Procedu

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).

--
Thanx!
  #2  
Old January 22nd, 2006, 02:53 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Referencing a Report's Control

Got it! Used the OnFormat Property, Thanx anyway.
--
Thanx!


"Tru" wrote:

I am trying to make a Label Control Visible based on the value of a Textbox
in my Report's Open Procedu

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).

--
Thanx!

  #3  
Old January 22nd, 2006, 03:36 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Referencing a Report's Control

Tru wrote:

I am trying to make a Label Control Visible based on the value of a Textbox
in my Report's Open Procedu

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).



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.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem referencing a control Mr. T. Using Forms 3 June 9th, 2005 02:45 PM
Control Wizard shows an empty list of reports Hugo Setting Up & Running Reports 0 May 24th, 2005 09:50 PM
Having trouble with multi-select list box in Access brandelfly New Users 4 February 10th, 2005 07:36 PM
Data Entry Mode bdehning Using Forms 17 November 22nd, 2004 04:49 PM
How to assign value to a report control? Peter General Discussion 3 June 29th, 2004 11:17 AM


All times are GMT +1. The time now is 08:02 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.