Calcluation of subform data - next field (1 Viewer)

Insane_ai

Not Really an A.I.
Local time
Yesterday, 22:10
Joined
Mar 20, 2009
Messages
264
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.
 

June7

AWF VIP
Local time
Yesterday, 18:10
Joined
Mar 9, 2014
Messages
5,463
Code in control AfterUpdate event to commit record. One version:

Me.Dirty = False
 

Insane_ai

Not Really an A.I.
Local time
Yesterday, 22:10
Joined
Mar 20, 2009
Messages
264
Thanks June7,

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

Users who are viewing this thread

Top Bottom