subReport on Form- refer to subReports field from code in form

I have a form frmMain that has a subreport subCurrentPrice that has a field called PriceAtClose.

I would like to refer to that subreports field from code within the form.

how can I do that?

it seems from my search that mixing/putting a subReport on a form is a slightly different animal.
scbdpmAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
Actually, since we're dealing with a sub-report, it would be:

Forms!frmMain!subCurrentPrice.report.PriceAtClose

Me.subCurrentPrice.report.PriceAtClose


0
 
Dale FyeCommented:
From the main form, you can use the following to refer to that control:

Forms!frmMain!subCurrentPrice.form.PriceAtClose

0
 
mbizupCommented:
From a seperate form:

Forms!frmMain!subCurrentPrice.form.PriceAtClose

From the main form:

Me.subCurrentPrice.form.PriceAtClose


Make sure that subCurrentPrice is the name of the control that 'houses' the subform.  This may be different from the name of the subform as seen in the database window.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Dale FyeConnect With a Mentor Commented:
note that "subCurrentPrice" should be the name of the subreport control on the main form (which will not necessarily be the actual name of the form that is the SourceObject for that control).
0
 
Dale FyeCommented:
good catch!
0
 
scbdpmAuthor Commented:
I selected both because they both led me to the answer. While mbizup ultimately had the 'report.', fyed also said 'the name of the sourceobject' and I was able to understand!

thanks to you both!
0
 
mbizupCommented:
Glad to help out!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.