Solved

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

Posted on 2015-02-19
4
112 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 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

740 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