Subform Refresh

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
 
M

Maurice

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
 
M

Maurice

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...
 
D

D

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...
 
M

Mike Painter

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top