popup - Requery subform (1) after adding a new subform (1) record via pop-up subform (2) - Access 2007 -
i have form 2 subforms (1 , 2). subform 1 stores data continously account breakdowns. using pop-up subform (subform 2), user enters data change or update account breakdown stored on subform 1. on submit, information stored in sub-table linked subform 1, data not refresh , add new information in new record in subform 1 unless manually click refresh button in home tab.
so far, have tried following code on form_afterupdate of subform 2, requery subform 1 automatically creates run-time error (2450) when main form closed:
private sub form_afterupdate() on error goto err_form_afterupdate forms!frmspendplan!frmspendplansub.form.requery exit_form_afterupdate: exit sub err_form_afterupdate: msgbox err.description resume exit_form_afterupdate end sub
if has way automatically requery subform 1 data once subform 2 submitted without creating error please let me know, appreciate can provide.
thanks!
i have same problem sometimes! form doesn't refresh properly.
method 1
try line of code instead of current requery code. shouldn't give error may still not work due bugs...
form_frmspendplansub.requery
i use format reference across forms , works usually.
method 2
1) can try in design view click on form doing "after_update"
2) right-click on form , click "build event.." , select "expression builder"
in expression builder can see how form in links form want , want do...
so navigate going forms--> loaded forms--> frmspendplansub , list can double click on " " referenced form want affect. have copy code gives in box above vba code , reference want do...
e.g.
forms![frmmainform]![frmsecondform].form![frmthirdform].form.requery
anyway hope helps...
Comments
Post a Comment