How do I repaint a subform from a vba module?

I have opened a form that contains a subform.  i would like the subform to repaint or refresh after a (lengthy) code has run and derived results to the driving back end table.  I have tried Forms![mysubform name].Repaint but I keep getting an error that the system cannot find the object.  I have checked spelling, etc.

Thanks.
keithedwardbAsked:
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.

MacroShadowCommented:
You must use the name of the subform control, the syntax would be:
Forms![MainForm]![mysubform CONTROL Name].Form.Requery
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
IT Project MgrVBA/SQL developerCommented:
You could try setting the focus to the subform, and then using the Refresh or Requery command.

Refreshing records only updates the data that already exists in your datasheet or form. It does not reorder records, display new records, or remove deleted records and records that no longer meet specified criteria. To do that, you can requery the records.

If you have the main form open, you should be able to use something like this:

      Me.mySubformName.SetFocus
      Me.Refresh

Alternately:
      Me.mySubformName.SetFocus
      Me.Requery
0
keithedwardbAuthor Commented:
Sorry for the apparent delay.  I have not used the system in a while and did not know how to accept an answer. (until I logged in!). Your answer solved my problem.
Thankyou.
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.