Afterupdate Event to 'refresh' subform

Sniper-BoOyA-

Registered User.
Local time
Today, 09:08
Joined
Jun 15, 2010
Messages
204
Good morning,

First i'd like to thank everyone who helped me in the past. All Databases and its features are Live now, and no complaints yet.

I am working on yet an other database though, and i cant seem to figure this out.

Ive created a form with 4 subforms.

1st one is to display the data of a table
2nd one displays a graph based on the data of the table
3rd one is to manually add/modify points to the graph
4th one is for a sigle calculation

The problem i am facing at the moment is concerning subform 2 and 3.

I would like the graph to update after a change is being made on subform3.

Now i have tried to put the following things into the AfterUpdate event of subform3

Code:
Forms("MainFormName").Controls("Subform3").Requery

Code:
Forms!("Subform3").Requery
Code:
Forms("Subform3").Requery

Ive also put the

Code:
me.Nameofgraph.Requery

Code:
Forms(subformprctrgrfk!Grafiek156).Requery

on the FormLoad() event of the subform that contains the graph. Which works, but as u might have guessed the form only gets loaded ones, and so it won't requery untill u close to mainform and reopen it.

I eventually added a button on the subform with the graph, which works eventually, but it would be so much effecient to 'refresh' once data on subform3 is being changed/added.

Do you have any ideas??

Oh ya before i forget:

The names of the forms are as follows:

MainForm:Formproctor
Subform1: subformproctor (Original data table)
Subform2: subformprctrgrfk (contains graph)
Subform3: subformprctrextra (Manually add/edit points to graph)
Subform4: subformprctrmax (single calculation)



Cheers!
 
Nevermind..

Ive decided to keep the button, instead of letting it update automatically.
 
A change to a value in a control on the subform does not propogate to the recordset until the record is saved. It should work if you first save the record in the AfterUpdate of the control.

You cannot refer to a form object shown in the subformcontrol via the Forms collection. It must be referenced via the main form (either from the Collection or from Me), the subformcontrol and the Form property.

Also note that a Requery of a subform will requery the controls on that subform from the form's existing recordset.
Code:
Forms!mainformname!subformcontrolname.Requery
or
Code:
Me!subformcontrolname.Requery

To load new data you need to requery the subform source object.
Code:
Forms!mainformname!subformcontrolname.Form.Requery
or
Code:
Me!subformcontrolname.Form.Requery
 

Users who are viewing this thread

Back
Top Bottom