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 / Modules / DAO / VBA / March 2007

Tip: Looking for answers? Try searching our database.

Transfering Data from a subform to a parent form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 15 Mar 2007 09:23 GMT
I have developed a purchase order form which has a subform that is the
itemized list of of purchases.  On this subform I have a footer with an
unbound text box (Total) with this formula in it  =(Sum([DebitAmount])).  
This works well except it only updates when I go to add the next item on the
subform.  

I would like to transfer this total to the parent form txtSubtotal text box
for further calculations.
Marshall Barton - 15 Mar 2007 17:22 GMT
>I have developed a purchase order form which has a subform that is the
>itemized list of of purchases.  On this subform I have a footer with an
[quoted text clipped - 4 lines]
>I would like to transfer this total to the parent form txtSubtotal text box
>for further calculations.  

The parent form can use a text box expression such as:
    =subform.Form.Total

The subform record must be saved before the total can be
updated.  Going to any other record is one action theat will
force a record to be saved.

Signature

Marsh
MVP [MS Access]

Kevin - 16 Mar 2007 09:40 GMT
I have tried this expression with no results.  

One way I solved the problem was to enter "Parent!Total = Me!Subtotal" in
the Lost Focus event of the Subtotal text box.  Is there a way in code to
change the focus of that text box so that event is performed automaticly
instead of having to put the curser in that field and then remove it to
update the total field

Kevin

> >I have developed a purchase order form which has a subform that is the
> >itemized list of of purchases.  On this subform I have a footer with an
[quoted text clipped - 11 lines]
> updated.  Going to any other record is one action theat will
> force a record to be saved.
Marshall Barton - 16 Mar 2007 21:59 GMT
In my experience, that approach doesn't always work (it's a
timing thing).

If you force the new/modified record to be saved, everything
is supposed to update automatically.  I don't have any idea
where/when you would want to save the record (maybe a
button???), but the code is simply:
    If Me.Dirty Then Me.Dirty = False
Signature

Marsh
MVP [MS Access]

>I have tried this expression with no results.  
>
[quoted text clipped - 19 lines]
>> updated.  Going to any other record is one action theat will
>> force a record to be saved.
fuzzyEuclid - 19 Mar 2007 16:07 GMT
In the subform control's AFTER UPDATE event, put use the "Refresh" command - this will force the subform to update it's recordset/table. Right underneath the Refresh command you can put the code to update the parent form's box.

Hope I understood your problem, and hope that I actually helped!

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
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.