Solved

Display a value from another form

Posted on 2015-01-21
7
129 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
  • 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
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)

 

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

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now