Solved

getting value for a report from a form based on current form

Posted on 2015-02-19
4
109 Views
Last Modified: 2015-02-19
I have an unbound control or field on a report that I would like to get the contents from an active and open form. Using the following syntax doesn't seem to work for me:

=[Forms]![frmCCOrder]![frmCCFormLineItems].[txtProject]

frmCCOrder is the name of my main form, frmCCFormLineItems is the name of my subform where my control lies, and txtProject is the name of the control from which I want to retrieve my data.

All I get when I preview the form using this is ?Name.

Any idea what I may be doing wrong?
0
Comment
Question by:Shooter54
  • 2
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40619248
You refer to a Subform like this:

Forms!ParentForm!NameOfYourSubformCONTROL.Form.NameOfTheControlOnTheSubform

The "NameOfYourSubformCONTROL" is the tricky part. It's a "container" control, and it's placed on your parent form, either by you or by Access. To determine the name, open the parent form in Design view, and click ONCE on the edge of the subform. Note the Properties box, Other tab - the value in the Name property is the one you want.

 Subform 2
0
 

Author Comment

by:Shooter54
ID: 40619284
Thanks! Quick fix to what should have been a simple issue.
=[Forms]![frmCCOrder]![frmCCFormLineItems].[Form].[txtProject]
instead of
=[Forms]![frmCCOrder]![frmCCFormLineItems].[txtProject]
0
 

Author Closing Comment

by:Shooter54
ID: 40619285
Speedy response, saved the day! Thanks again.
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40619288
I don't Think it will be possible to do that if the control is in details or group section of the report,
you can use global or public variable to hold the required value when report shown and access that variable
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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.

930 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now