Requery a Query in a Subform

I have a database with one main form and in it are two sub forms. Sub form 1 updates a separate table. Sub form 2 displays the results of a query based upon the input from subform 1. When the user adds information to the table, I need the query to re-run (or the sub-form 2 to requery) when new data is added to the table. However using Requery [code_to_subform2] nothing appears to happen. I guess I am on the wrong track here ..

any help on this would be appreciated.

Thanks,

Mike
LVL 4
mikemAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DedushkaCommented:
Hi mikem.
Try to do this in Subform1 AfterUpdate event:

me!Parent!Subform2.Form.Requiery

Regards,
Dedushka
0
mikemAuthor Commented:
Didnt quite work, however it put me on the right track and I have it working now. Thank you... If you re-submit as an answer I will give you the points.

Mike
0
mikemAuthor Commented:
For info I did the folowing:

DoCmd.GoToRecord , , acNewRec
Forms![MainForm]![SubForm2].Form.Requery

I had to do this through a click_event on a button. First it updates
the table with the new info and goes to a new record, then your code (slightly modified) after this event.

Thanks again

MIke
0
DedushkaCommented:
Thank you for accepting my answer.
Have a nice day,
Dedushka
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JimMorganCommented:
Dedushka:

Er, you forgot to mark you acceptance as an answer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.