By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,894 Members | 1,942 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,894 IT Pros & Developers. It's quick & easy.

Referring to a control in a subform on a subreport

100+
P: 166
Hello,

I would like to copy a calculated control of an unbound control on to
a report. On my form (F_SampleRequest) i have a button which opens
the report. Here is the code for the button:

Private Sub btnOpenSampleReport_Click()

DoCmd.OpenReport "R_SampleRequest"
'Open Report SampleRequest


Reports!R_SampleRequest.SR_SampleReqRep.Report!txt RptWat =
SF_MixSample.Form!ListWater
Reports!R_SampleRequest.SR_SampleRequest.Report!tx tRptWaterReq =
SF_MixSample.Form!txtWaterReqWt

End Sub

My report contains a subreport (SR_SampleReqRep) which has 2 text
boxes (ListWater and txtwaterReqWt) which I wish to be copied into
from the SF_mixSample subform. This code prints the report as opposed
to copying the information into the report. I have used similar code
to copy from one form to the next, so I thought i could do the same
with a report and subreport. How can I copy a value from a subform
to a subreport?
Dec 11 '08 #1
Share this Question
Share on Google+
3 Replies


nico5038
Expert 2.5K+
P: 3,072
For all information on referring to form controls check:
Forms: Refer to Form and Subform properties and controls
(Much other interesting stuff there!)

On the other hand, when calculated on a form you could also add the calculation in the (sub)report's query and to transfer is needed.

Nic;o)
Dec 11 '08 #2

100+
P: 166
Each of the controls I need are unbound, so I can't refer to them in the query, which is why I just wanted to xfer it.

That link refers to forms but I need the information related to reports.
Dec 11 '08 #3

nico5038
Expert 2.5K+
P: 3,072
Just read for form report and subform subreport :-)

I do understand that a calculated value is stored in an unbound field, but the calculation will use fields from a table I assume. That calculation can be placed in a query.

Nic;o)
Dec 11 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.