?
Solved

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

Posted on 2011-10-31
7
Medium Priority
?
336 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:scbdpm
  • 3
  • 3
7 Comments
 
LVL 49

Expert Comment

by:Dale Fye
ID: 37056834
From the main form, you can use the following to refer to that control:

Forms!frmMain!subCurrentPrice.form.PriceAtClose

0
 
LVL 61

Expert Comment

by:mbizup
ID: 37056840
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
 
LVL 49

Assisted Solution

by:Dale Fye
Dale Fye earned 400 total points
ID: 37056846
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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 61

Accepted Solution

by:
mbizup earned 1600 total points
ID: 37056882
Actually, since we're dealing with a sub-report, it would be:

Forms!frmMain!subCurrentPrice.report.PriceAtClose

Me.subCurrentPrice.report.PriceAtClose


0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 37056894
good catch!
0
 

Author Closing Comment

by:scbdpm
ID: 37056917
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
 
LVL 61

Expert Comment

by:mbizup
ID: 37057090
Glad to help out!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question