Subform Refresh

  • Thread starter Thread starter D
  • Start date Start date
D

D

Hi:

I have a main form and a sub form; when data is entered in the main form the
corresponding field n the sub form(is a multiplication) is not refreshing
unless I am going to the next record in the main form, and go back.

Could you please tell me what needs to be done to see the update in the sub
form without doing the above?

Thank you,

Dan
 
it depends on when you want the event to be triggered. You could place a line
in VBA when leaving a specific field.

example: suppose you want te refresh when you 'leave' the textbox1 in that
case do the following:

in the properties of the textbox go to the event tab. Click on the three
dots besides the textbox. Choose codebuilder here.

When in the VBA window between the sub and end sub place the following line:

me.nameofsubform.requery

Where nameofsubform is the actual name of your subform.
Click on the savebutton and try to open the form and see if that works.

hth
 
Ok, that could be because the main form is still 'Dirty' in that case try
putting me.dirty=false before the line where you requery the subform (in the
same sub). Try and let us know...
 
It is OK now!

Thanks a lot!

Dan

Maurice said:
Ok, that could be because the main form is still 'Dirty' in that case try
putting me.dirty=false before the line where you requery the subform (in the
same sub). Try and let us know...
 
In the Afterupdate event for that field try
Forms!YourMainForm.refresh.
This work even if the field is in a subform on the mainform and you want to
update another subform.
 
Back
Top