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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |