Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-17-2018, 01:03 PM   #1
Insane_ai
Newly Registered User
 
Join Date: Mar 2009
Location: Cleveland, OH USA
Posts: 213
Thanks: 9
Thanked 21 Times in 18 Posts
Insane_ai is on a distinguished road
Calcluation of subform data - next field

I have a form with a subform.

The subform is presented in DataSheet view so the user can edit a subset of data based on the selection of the filters employed.

I have a field in the header of the subform [txtMyTotal]and a field in the footer of the Main form [txtClassTotal] to keep a total of one of the fields.

Both Dsum("Field","Table","Criteria") and =[txtClassSum] work on the footer of the form. The problem is getting it to update.

I want my user to be able to change the data and see the resulting effect on the sum immediately. As it is now, I have to exit the record (which commits the data) to get either of the totaling fields to update. I accept that data has to be committed before it can be retrieved and manipulated.

The problem comes with "Which field was chosen when I left this one".


The following code almost does what I need it to do:
Code:
        Me.Recordset.MoveNext
        Me.Recordset.MovePrevious
        Forms("Class_Mgmt").Requery
        Forms("Class_Mgmt").txtClassTotal.Requery
I can then set focus on another field but I won't know if the user tabs over, or uses a directional arrow to move to another field. I need to capture that part so when I cycle through the records and the total field is updated, the user doesn't know anything happened.

__________________
I actually know a few things, just not all of them.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Insane_ai is offline   Reply With Quote
Old 08-17-2018, 01:19 PM   #2
June7
Newly Registered User
 
Join Date: Mar 2014
Posts: 588
Thanks: 0
Thanked 136 Times in 136 Posts
June7 will become famous soon enough
Re: Calcluation of subform data - next field

Code in control AfterUpdate event to commit record. One version:

Me.Dirty = False
__________________
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
June7 is offline   Reply With Quote
The Following User Says Thank You to June7 For This Useful Post:
Insane_ai (08-17-2018)
Old 08-17-2018, 01:27 PM   #3
Insane_ai
Newly Registered User
 
Join Date: Mar 2009
Location: Cleveland, OH USA
Posts: 213
Thanks: 9
Thanked 21 Times in 18 Posts
Insane_ai is on a distinguished road
Re: Calcluation of subform data - next field

Thanks June7,

Ridders has had me chasing deep stuff the past two weeks with his Security Challenges that I forgot simple answers.

__________________
I actually know a few things, just not all of them.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Insane_ai is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
data from one field to fill in field in subform Bilal Forms 8 11-27-2013 04:26 AM
Copy value from field in subform to field in mainform during data entry glawson Forms 10 07-22-2013 07:18 AM
missing field data in subform CHAOSinACT Queries 14 06-02-2010 05:09 PM
Combined field from all subform data treva26 Modules & VBA 3 11-25-2007 04:37 PM
Copy field data to subform? erkerns Forms 8 06-14-2003 04:42 PM




All times are GMT -8. The time now is 03:02 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World