Using data from one subform in the calculation of another

M

Mark Schwartz

I have a database with three tables. A parent and two children, with
a query for each table that lets me do some calculations on the data
of each table. I built a form of the parent query that includes
subforms of each of the children queries. The children are not
identical, one of them, we'll call it the younger child, needs to make
a calculation based on a sum of data specific to the parent record
from the older child. What I want to do is build a form so that as
data is changed in the subform of the older child query the subform
for the younger child query changes to reflect the new data, without
having to close and then reopen the form.
 
E

Eric Butts [MSFT]

Hi,

If you are just needing to refresh the data in the subForm use the
following code that can be called via a command button OnClick event:

Forms![name of main form]![name of subform
control].Form.Requery


I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| From: (e-mail address removed) (Mark Schwartz)
| Newsgroups: microsoft.public.access.queries,microsoft.public.access.forms
| Subject: Using data from one subform in the calculation of another
| Date: 23 Mar 2004 18:01:19 -0800
| Organization: http://groups.google.com
| Lines: 10
| Message-ID: <[email protected]>
| NNTP-Posting-Host: 63.226.220.8
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1080093680 5940 127.0.0.1 (24 Mar 2004
02:01:20 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Wed, 24 Mar 2004 02:01:20 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news.glorb.com!postnews2.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:260533
microsoft.public.access.queries:194891
| X-Tomcat-NG: microsoft.public.access.queries
|
| I have a database with three tables. A parent and two children, with
| a query for each table that lets me do some calculations on the data
| of each table. I built a form of the parent query that includes
| subforms of each of the children queries. The children are not
| identical, one of them, we'll call it the younger child, needs to make
| a calculation based on a sum of data specific to the parent record
| from the older child. What I want to do is build a form so that as
| data is changed in the subform of the older child query the subform
| for the younger child query changes to reflect the new data, without
| having to close and then reopen the form.
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top