Change Text Field value from Button Control

  • Thread starter granola911 via AccessMonster.com
  • Start date
G

granola911 via AccessMonster.com

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!!!
 
M

Marshall Barton

granola911 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top