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
|
|||
|
|||
Change Text Field value from Button Control
Hi,
thanks in advance for any help on this. I have 2 reports: The first is a summery of project charges. From this report I want to provide 2 buttons, both will perform the same task which is to open the second report, the only difference is that I want the first button to set a text field value in report 2 page headter to the word "QUOTE", and button number 2 would set the same field to "INVOICE". The setValue works perfectly if I open report 2 in REPORT view, but doesn't work at all if I open the report in PRINT PREVIEW. I would really like my users to just be able to click the button and go right to print preview rather than have the awkward step of passing through REPORT view needlessly. I have even tried to write my macro to open the report HIDDEN, set the value save and close, and then open in PRINT PREVIEW, but that didn't work. Here isthe macro to drive each button here is what I've done: open report 2 to the correct record setValue [Reports]![r_Invoice]![IsQuote], "- QUOTE - " I have no clue why it works perfectly in report view and not in print preview. Thanks!!! -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Change Text Field value from Button Control
granola911 via AccessMonster.com wrote:
I have 2 reports: The first is a summery of project charges. From this report I want to provide 2 buttons, both will perform the same task which is to open the second report, the only difference is that I want the first button to set a text field value in report 2 page headter to the word "QUOTE", and button number 2 would set the same field to "INVOICE". The setValue works perfectly if I open report 2 in REPORT view, but doesn't work at all if I open the report in PRINT PREVIEW. I would really like my users to just be able to click the button and go right to print preview rather than have the awkward step of passing through REPORT view needlessly. I have even tried to write my macro to open the report HIDDEN, set the value save and close, and then open in PRINT PREVIEW, but that didn't work. Here isthe macro to drive each button here is what I've done: open report 2 to the correct record setValue [Reports]![r_Invoice]![IsQuote], "- QUOTE - " I have no clue why it works perfectly in report view and not in print preview. I don't understand what report view is good for unless maybe it's some kind of sharepoint services thing. The timing of when things happen when you open a report in normal or preview is such that you are probably trying to set the value before the report is in a state that can deal with it. The standard way to what you want is to have the report set the value itself. Pass the value in the open report method's OpenArgs argument. Then the report can set the value of the text box in the format event of the section containing the text box. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|