subform infor on main form!

J

JOM

I have information entered in the subform by date, would like to display the
total of the subform for that date on the main form. e.g, I have the
follwing information enetered in the subform
date item hoursspent
10/11/2005 abcd 2
10/12/2005 xyza 5
10/12/2005 qazx 2

Main form has the following
Todays (10/12/05) total hours = 7
This weeks Total hours = 9
 
R

Roger Carlson

Total the values in the subform in a textbox control. The recordsource of
the control will look something like this: =sum(hoursspent). Then,
reference the value of this control in a textbos on the main form. The
ControlSource for the textbox on the main form would look something like
this:
=forms!MainForm!SubformControl.Form!TheTextBox

The above assumes your main form is named MainForm, your subform control
(that is the control on the main form that holds the subform) is named
SubformControl, and the textbox on the subform that holds the total is named
TheTextBox.

On my website (www.rogersaccesslibrary.com), is a small Access database
sample called "SubformReference.mdb" which illustrates how to do this (as
well as a bunch of other things with referencing subforms).

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

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