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