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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pass a Report Value to a Form?



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2009, 06:11 PM posted to microsoft.public.access.forms
Pascoe via AccessMonster.com
external usenet poster
 
Posts: 32
Default Pass a Report Value to a Form?

Hi guys,

I want to run a report in the background, take a final value from the report,
and pass it back into my form, to be displayed.

I know I can easily do this from one form to another form, but as I already
have the report, I was being lazy, and figured I could just take the value
from the report using a macro.... but it doesn't seem to work.

Is there a way of doing this? Or am I being stupid (as well as lazy)?

Thanks!
Russell.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #2  
Old November 18th, 2009, 06:50 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Pass a Report Value to a Form?

Pascoe,
Well, it's a bit unusual for a report to be passing data back
to a form's dataset... which probably would be the source for the report's
recordset... but...
While the for is still open... use the OnFormat event of the report
section
that contains the control value to be passed.
Example:
Form = frmMainForm
Form text control name = ReportValue
Report section = Report Footer
Report text control name = PassValue

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Forms!frmMainForm!ReportValue = Me.PassValue
End Sub

Unable to test, but... that should do it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"Pascoe via AccessMonster.com" u43716@uwe wrote in message
news:9f4f4b1ac405e@uwe...
Hi guys,

I want to run a report in the background, take a final value from the
report,
and pass it back into my form, to be displayed.

I know I can easily do this from one form to another form, but as I
already
have the report, I was being lazy, and figured I could just take the value
from the report using a macro.... but it doesn't seem to work.

Is there a way of doing this? Or am I being stupid (as well as lazy)?

Thanks!
Russell.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1



  #3  
Old November 19th, 2009, 03:34 PM posted to microsoft.public.access.forms
Pascoe via AccessMonster.com
external usenet poster
 
Posts: 32
Default Pass a Report Value to a Form?

Al,

Thanks for your response.

Let me give that a go. I might just take the non-lazy approach and rewrite
the report in a form if i can't nake your route work.

Thanks.
Russell.

Al Campagna wrote:
Pascoe,
Well, it's a bit unusual for a report to be passing data back
to a form's dataset... which probably would be the source for the report's
recordset... but...
While the for is still open... use the OnFormat event of the report
section
that contains the control value to be passed.
Example:
Form = frmMainForm
Form text control name = ReportValue
Report section = Report Footer
Report text control name = PassValue

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Forms!frmMainForm!ReportValue = Me.PassValue
End Sub

Unable to test, but... that should do it.
Hi guys,

[quoted text clipped - 11 lines]
Thanks!
Russell.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1

  #4  
Old November 20th, 2009, 01:45 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Pass a Report Value to a Form?

Pascoe,
Please post back if you're successful. We like to know if out
suggestions
are working.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Pascoe via AccessMonster.com" u43716@uwe wrote in message
news:9f5a80ae9704a@uwe...
Al,

Thanks for your response.

Let me give that a go. I might just take the non-lazy approach and rewrite
the report in a form if i can't nake your route work.

Thanks.
Russell.

Al Campagna wrote:
Pascoe,
Well, it's a bit unusual for a report to be passing data back
to a form's dataset... which probably would be the source for the report's
recordset... but...
While the for is still open... use the OnFormat event of the report
section
that contains the control value to be passed.
Example:
Form = frmMainForm
Form text control name = ReportValue
Report section = Report Footer
Report text control name = PassValue

Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Forms!frmMainForm!ReportValue = Me.PassValue
End Sub

Unable to test, but... that should do it.
Hi guys,

[quoted text clipped - 11 lines]
Thanks!
Russell.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200911/1



 




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 10:20 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.