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
|
|||
|
|||
assigning a value to a text box
How do I set a value of a text box on a report??
In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#2
|
|||
|
|||
Do it in the Format event of the section that contains the textbox.
-- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#3
|
|||
|
|||
I have this exact problem. Every method I've tried to
pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Just curious. -----Original Message----- Do it in the Format event of the section that contains the textbox. -- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. . |
#4
|
|||
|
|||
The Open event is too soon to assign a control's Value
property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#5
|
|||
|
|||
OK...What if I have a subreport with textboxes that I want to populate. Also
I have more than one occurrence of the subreport. "Marshall Barton" wrote in message ... The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#6
|
|||
|
|||
Use the Format event of the subreport.
-- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... OK...What if I have a subreport with textboxes that I want to populate. Also I have more than one occurrence of the subreport. "Marshall Barton" wrote in message ... The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#7
|
|||
|
|||
Sorry, I mean the Format event of the section in the subreport.
-- Ken Snell MS ACCESS MVP "Ken Snell [MVP]" wrote in message ... Use the Format event of the subreport. -- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... OK...What if I have a subreport with textboxes that I want to populate. Also I have more than one occurrence of the subreport. "Marshall Barton" wrote in message ... The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#8
|
|||
|
|||
Ken, thanks for the help.
I am having a learning curve. It seems I can set text boxes on the main report but what of the text boxes in the sub reports? I have tried: Reports!rpt_calendar.Controls(subreport7).txb_Name 1.Value = "12345" does not work..."type mismatch"...any ideas "Ken Snell [MVP]" wrote in message ... Sorry, I mean the Format event of the section in the subreport. -- Ken Snell MS ACCESS MVP "Ken Snell [MVP]" wrote in message ... Use the Format event of the subreport. -- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... OK...What if I have a subreport with textboxes that I want to populate. Also I have more than one occurrence of the subreport. "Marshall Barton" wrote in message ... The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#9
|
|||
|
|||
It sounds as if you're using the format event of the main report. I said to
use the format event of the subreport's section, not the main report's section, when you want the subreport to set a value to its own textbox. And there you'd just use this: Me.txb_Name1.Value = "12345" Also, your syntax for referring to a subreport's control is not quite right: Reports!rpt_calendar.Controls("subreport7").Report .txb_Name1.Value = "12345" This assumes that subreport7 is the name of the control that holds the subreport. -- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... Ken, thanks for the help. I am having a learning curve. It seems I can set text boxes on the main report but what of the text boxes in the sub reports? I have tried: Reports!rpt_calendar.Controls(subreport7).txb_Name 1.Value = "12345" does not work..."type mismatch"...any ideas "Ken Snell [MVP]" wrote in message ... Sorry, I mean the Format event of the section in the subreport. -- Ken Snell MS ACCESS MVP "Ken Snell [MVP]" wrote in message ... Use the Format event of the subreport. -- Ken Snell MS ACCESS MVP "Jeff" wrote in message ... OK...What if I have a subreport with textboxes that I want to populate. Also I have more than one occurrence of the subreport. "Marshall Barton" wrote in message ... The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
#10
|
|||
|
|||
Ok - this should be clearly documented in the product.
Thanks, Nick "Marshall Barton" wrote: The Open event is too soon to assign a control's Value property. However, you can set several other control/section properties in the Open event, including the ControlSource property. Since the ControlSource property determines how a control's Value is calculated, it's necessary for this to be resolved before it can be determined if a control is in fact unbound. Forms have a Load event that is appropriate for assigning a value to unbound controls. Since reports do not have a Load event, you can use the Format event of any section that is processed no later than the section containing the control. -- Marsh MVP [MS Access] nickpup wrote: I have this exact problem. Every method I've tried to pass data to a report, which should be very simple does not work. I understand that you have apparently posted a solution but: 1) This does not seem at all logical. Why is a global variable *not* recognized in a report? 2) Why can't you just set the value of the control as was attempted below, for example in the open event? Why have report controls with properties that can't be changed in code? Why would Microsoft program an error message like 'you cannot do that', with no reason or solution given? What are we not understanding here? 3) Why does this work only from the format event? Where is this documented, and if it is not, why not? In other words, as a developer I abhor situations where there is apparently devious weired behaviour that does not make sense and can only be discovered through extraordinary means. I have spent WAY too much time with this very issue. Did I miss something or not understand something? Ken Snell wrote: Do it in the Format event of the section that contains the textbox. -----Original Message----- "Jeff" wrote How do I set a value of a text box on a report?? In the reports report_open event I have txt_month.value = str_month str_month is public from another form error is: you can't assign a value to this object. |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A challenging question on text boxes-word 2000 | fw76 | Page Layout | 16 | October 18th, 2004 11:45 PM |
Too many hyperlinks? | [email protected] | Powerpoint | 7 | May 25th, 2004 02:19 AM |
Vertical Text Orientation | Paul Anderson [MSFT] | Visio | 0 | May 11th, 2004 05:16 PM |
Column separator crosses through wrapped text box | Bob S | Page Layout | 0 | April 25th, 2004 09:52 PM |
Extracting text | Nemo | Worksheet Functions | 3 | April 6th, 2004 02:33 PM |