refresh subform

T

twalsh

I have a main form with a textbox which is the criteria in a simple Select
Query

A subfrom on this main form is based on the Select Query.

How can i change the value in the text box and requery to update the data in
the subform?
 
K

Klatuu

Modify the subform's record source query to be filtered by the content of the
text box and in the after update event of the text box, requery the subform.

So you would have a criteria in the query like
Forms!MyMainFormName!MyTextBox Name

And then in the After Update event.

Me.MySubformControlName.Form.Requery
 
F

Felix

I have similar problem.
the difference is my textbox contain date with automatically default to
today's date. Everytime I add data into subform's table, the new data did not
appear unless I enter new date on the textbox to fire up the after update
event or press F5 key to refresh the form. The textbox not necessarily need
to update if the same date still be using.

My question is:
How do I make the textbox automatically update the value (can be defaulted
to today's date) so it will fire-up the after update event?
is there any other way to do the trick?

thanks,
Felix
 

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