Refresh Subform Records (1 Viewer)

captain1974

Registered User.
Local time
Today, 13:58
Joined
Jan 15, 2007
Messages
43
I am having difficultly refreshing records in subforms.
I have a main form with 3 subforms, all junior to each other. I have tried the advice in this thread http://www.access-programmers.co.uk/forums/showthread.php?t=124648 with no success. I'm not sure if it is because I have 4 forms in total?
I have other similar forms which don't need the afterupdate event to refresh/requery the subform's record, however those forms only contain 2 subforms.
I've attached a copy of the relevant part of my database for reference.
 

Attachments

  • RefreshSfrmProblem.zip
    37 KB · Views: 415

BrettStah

Registered User.
Local time
Today, 00:58
Joined
Apr 15, 2007
Messages
49
Try this, in the OnCurrent event procedure of the main form:

[SubFormNameGoesHere].Requery
 

captain1974

Registered User.
Local time
Today, 13:58
Joined
Jan 15, 2007
Messages
43
Try this, in the OnCurrent event procedure of the main form:

[SubFormNameGoesHere].Requery

Thanks, that partially fixes the problem. Now when I select from the first combo (Vineyard) it requeries the subforms as long as there is no data that is relevant to that 1st combo/vineyard. However, I don't want any data to appear unless it is specific to the 2nd combo box (block). So this takes me back to creating an event procedure in the before or after update event of the subform which I can't get to work.
 

captain1974

Registered User.
Local time
Today, 13:58
Joined
Jan 15, 2007
Messages
43
Due to other work commitments I have not been able to work on this problem for the last few days, but having another look now.

I have tried writing a requery procedure in the afterupdate event with no success.
My main form is called frmEnterBudDissection this contains a subform called fsubBlock, this subform contains a subform called fsubBudDissection, this subform contains a form called fsubNodeDetails.
So as already explained the last 2 forms are not updating.
I have tried:
Me.Parent!fsubNodeDetails.Form.Requery in the after update event of fsubBudDissection
& also:
Forms!frmEnterBudDissection.fsubBlock.fsubBudDissection.Form.Requery
in the fsubblock afterupdate event.
And various combinations of this syntax in after update events of all the subforms. All with no success.

I would be grateful for any help I could get with this.
 

captain1974

Registered User.
Local time
Today, 13:58
Joined
Jan 15, 2007
Messages
43
Ok, fixed it.
I rebuilt the last subform using the wizard (actually one of the first things that I wanted to try but I was initially using a work computer with a 'compact' version of office which doesn't have all the Access wizards), and it all works fine without requery event procedures. Can't see what the difference was though?!
 

Users who are viewing this thread

Top Bottom