Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-02-19
4
Medium Priority
?
118 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

661 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