Subforms refresh

  • Thread starter Thread starter Bob Howard
  • Start date Start date
B

Bob Howard

The second subform is unaware of the change to the underlying data and
requires that you perform a requery --- this can be executed in the form (or
subform) where the data is being changed as that form (or subform) is the
one aware that the requery is needed. Don't simply execute me.requery
however --- you'll need to point to the subform whose underlying
recordsource requires the requery. If the data change is made in the main
form, you can code something like me.[subform control name].form.requery.
If the data change is made in the other subform, you can code something like
me.parent.[subform control name].form.requery.
 
Hello all.

I have two subforms on a master form. The first forms affects Dlookups on
the second. When I change data on the first it often fails to recalc the
dlookups.

Please advise.

Thanks
 
Thank you very much. It worked great.


Bob Howard said:
The second subform is unaware of the change to the underlying data and
requires that you perform a requery --- this can be executed in the form (or
subform) where the data is being changed as that form (or subform) is the
one aware that the requery is needed. Don't simply execute me.requery
however --- you'll need to point to the subform whose underlying
recordsource requires the requery. If the data change is made in the main
form, you can code something like me.[subform control name].form.requery.
If the data change is made in the other subform, you can code something like
me.parent.[subform control name].form.requery.


Mike said:
Hello all.

I have two subforms on a master form. The first forms affects Dlookups on
the second. When I change data on the first it often fails to recalc the
dlookups.

Please advise.

Thanks
 
I have almost the same problem like this. I have main form with subform. If
the subform combo box cannot have the valid value, I have the msgbox to let
the user add in the master file. if selected yes, then the Item Master File
form pops-up (leaving the mainform/subform opened) and entering the
information (This is an unbounded form). Saved the information using
recordset. When the data written, I want the subform to be refreshed or
requeried but needs the mainform/subform to be loaded of course so that the
command will be ccarried out. My question, how about if the mainform/subform
is not opened? how do I test if certain form is being loaded or opened? what
is the code? I remembered one time I used the Isloaded function in Access 97
and it works, why in Access 2003 seems to have been revised?

I used the code in Access 97... If isloaded("the name of the form") then

thenameoftheform!subform!fieldname.requery
endif

I appreciate you help. Thanks for your time...

Jrb

Bob Howard said:
The second subform is unaware of the change to the underlying data and
requires that you perform a requery --- this can be executed in the form (or
subform) where the data is being changed as that form (or subform) is the
one aware that the requery is needed. Don't simply execute me.requery
however --- you'll need to point to the subform whose underlying
recordsource requires the requery. If the data change is made in the main
form, you can code something like me.[subform control name].form.requery.
If the data change is made in the other subform, you can code something like
me.parent.[subform control name].form.requery.


Mike said:
Hello all.

I have two subforms on a master form. The first forms affects Dlookups on
the second. When I change data on the first it often fails to recalc the
dlookups.

Please advise.

Thanks
 
Back
Top