Solved

Display a value from another form

Posted on 2015-01-21
7
134 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 85
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 85
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 85

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 85
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

718 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