Solved

Display a value from another form

Posted on 2015-01-21
7
132 Views
Last Modified: 2015-01-21
I have two forms and I would like to have Field D from Form A to be displayed in Field C in Form B.

Field D is sum calculation ....it's like taking a end total from one form and having it become the starting total for the next form.
0
Comment
Question by:Jass Saini
[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
  • 4
  • 3
7 Comments
 
LVL 84
ID: 40562211
You can refer to another OPEN form like this, from the current form:

Me.[Field C]=Forms![Form A].[Field D]

I'd think you'd put this in the Form's Open, Load or Current event.
0
 

Author Comment

by:Jass Saini
ID: 40562247
My fields are unbound as I have a calculation in them...so how do I refer back to the field..field name???
0
 
LVL 84
ID: 40562280
Did you test my code before posting? If so, does it not work?

Bound or Unbound should not matter. You're referring to the CONTROLS on the form.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:Jass Saini
ID: 40562394
So I have the field in my subform..and it's saying the it can't find the referenced form ....
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40562410
You failed to mention Subforms.

Are you trying to find a value that is ON a Subform? If so, you must refer to it correctly:

Me.SomeControl = Forms("ParentForm").SubFormCONTROL.Form.NameOfControl

Where "SubFormCONTROL" is the Name of the Subform Control on the Parent form (i.e. the form "hosting" the Subform)
0
 

Author Comment

by:Jass Saini
ID: 40562444
When you say subFormCONTROL...what does that mean??
0
 
LVL 84
ID: 40562710
A Subform CONTROL is a Control you put on a form, just like a Textbox or ComboBox. The Subform Control is a "container" control, since it "contains" other controls - in this case, a Form.

So you put a Subform Control on a Form, and then set the Source Object of that control to show the form you want displayed in the Subform.

If you create the Subform by dragging and dropping one Form onto another, then Access will name the Subform control the same as the form.

If you add a Subform control from the toolbox, Access will name it something like "SubForm1".

In the image below, you'll see a Form with two separate Subform controls. I've highlighted one, and shown the Property Sheet. The value in the "Name" Property is what you use.

Subform
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

763 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