A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change Text Field value from Button Control



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2010, 12:28 PM posted to microsoft.public.access.reports
granola911 via AccessMonster.com
external usenet poster
 
Posts: 10
Default 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  
Old January 9th, 2010, 10:45 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.