Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2007

Tip: Looking for answers? Try searching our database.

Control Source Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Professional_in_need_of help - 22 Oct 2007 14:39 GMT
I have a form(MainForm) that has 4 subforms(Subform1,-4),  I would like to
add a text box in each subform that will give me a running total of records
in that subform where Textbox(strEmailSent) is = Yes (This is a checkbox).  I
then want to take each one of those totals from each subform and create a
textbox in the main form that will add all the subforms totals together.  I
can't figure out what to put in the control source to make it do what I want.

Thanks...
Allen Browne - 22 Oct 2007 14:50 GMT
1. Open the first subreport in design view.

2. If you don't see a Form Footer section, then click Form Header/Footer on
the View menu. (You can set the Visible property of this section to No if
you don't want to see it.)

3. In the Form Footer, add a text box, and set properties like this:
   Control Source        = - Sum([strEmailSent])
   Format                   General Number
   Name                     txtEmailSentCount
This assumes your subform has a yes/no field named strEmailSent, and you
want to count the number of Yeses.

4. Test. Save. Close. Repeat for other subforms.

5. Open the main form in design view.

6. Add a text box with Control Source of:
   =[Subform1].[Form]![txtEmailSentCount]

7. Test. You can then add a plus sign, and similar expressions that refer to
the other subforms.

This will produce #Error if your subforms have no records to match, and they
are set up such that you cannot add new records. In this case, the Detail
section goes completely blank, and referring to the non-existent controls in
the subform generates an error. More info about this situation:
   http://allenbrowne.com/casu-20.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a form(MainForm) that has 4 subforms(Subform1,-4),  I would like to
> add a text box in each subform that will give me a running total of
[quoted text clipped - 8 lines]
>
> Thanks...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.