Refresh form after update of multiple fields

Drand

Registered User.
Local time
Tomorrow, 08:43
Joined
Jun 8, 2019
Messages
179
Hi

I have a continuous form which creates an income budget based on 12 fields - Jan thru Dec.

Each month is totaled in the form footer. The fields can be edited.

Is there a way to refresh the totals after any field is changed rather than having to put code in the after update event of each individual field?

Many thanks
 
Your tables are not designed correctly. Each month should be in a separate row, NOT a separate column. This type of design makes the users happy because it lets them enter data the way they did in their spreadsheets but it is ever so much harder to work with behind the scenes. If the users won't enter the data with a proper mainform/subform, then try the example below. The PDF explains the example

I've posted a database sample that can give you the look you want for data entry but store the data properly normalized so all other functions are not impeded by the poor table design.
 

Attachments

Sorry Pat

Bad choice of words in my question. My table is structured exactly as you state.

I am just looking to see if there is a "Universal" refresh option after any field is updated.

Thanks
 
you can have a public function in your form module called say refreshAll

Function RefreshAll()

me.requery

end function

then in form design view select all the controls that you want to use the function and on the events tab, after update event (where you would normally see [Event Procedure] put

=refreshAll()
 
Thanks for that. Works perfectly and a lot easier then coding each field!!
 
I am just looking to see if there is a "Universal" refresh option after any field is updated.
No. The reason being that forcing a record to save after entry in each field would eliminate the ability to do validation. So that will only happen if you decide to do it yourself. For Access to do otherwise would be to completely mess up how form events work.

If you put the calculation in the query, Access will update the form as its value changes.

CJ just told you how to get around Access. Don't expect to do any form level validation on this form. Requery forces Access to save the dirty record and then it reruns the query.
 

Users who are viewing this thread

Back
Top Bottom