Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Box

Status
Not open for further replies.

Carol57

IS-IT--Management
Nov 5, 2000
19
0
0
CA
I have a report that asks the user to state a year via a input box. Everything is fine. On the report, this year must be displayed in another area of the report.

Is there anyway, that this field - after update via the input box can copy the results and place the year in the other field without having the input box displayed again and asking for the year.

I have tried "After Updates", copying the control source of the 1st box into the 2nd box, but it still shows a second input box, or #name error.

Thanks.

 
If the control on your report into which you put the year is called txtYear, then you should be able to use its value elsewhere in other controls on the report by setting their controlsource property to "=txtYear" (without the quotes).

BTW, I've tested this with the Inputbox assignment happening on the reports OnActivate event.

Hope this helps,

Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Thanks for the reply Steve. One minor problem I neglected to tell you - The second field to be updated is on the 2nd page, which is where I think the problem is.

Any other thoughts.

Carol
 
Carol, which section of the report is the second field on, and can you tell me what you are using as the controlsource property of this field. Also, is it possible that you have a subreport on the report, and the second control is in this subreport?


Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Steve:

There is no subreport. The first textbox is AgreementStartYear and the control source reads:

=InputBox("Form No. HRF-2.01 - Please insert Calendar Year)

The second textbox is Agreement EndYear and is after a page break, again in the detail section.

Funny thing is that if both text boxes are within the same page - then it poses no problem. But if you have a page break, either hard or soft, then the controlsource does not carry-over???

Can you shed any light on this.

Carol


 
Carol,

Try the following:

(a) Move the Inputbox code to the OnActivate event associated with the report; ie. In this event, add the following code:

Dim R as Report: Set R = me
R!AgreementStartYear = InputBox("Form No. HRF-2.01 - Please insert Calendar Year")

The OnActivate event fires only ONCE, when the report is initially activated.

(b) Make sure that the ControlSource property for your Control is set to blank, as it will be populated (once) from the above event

That should hopefully fix the problem, as the InputBox Code which solicits the AgreementStartYear data will occur only once. The way you have it, it can be solicited multiple times.


Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
Thanks Steve - Works perfect now.

Carol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top