How do I repaint a subform from a vba module?

Posted on 2014-08-29
Last Modified: 2014-09-03
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.

Question by:keithedwardb
    LVL 26

    Accepted Solution

    You must use the name of the subform control, the syntax would be:
    Forms![MainForm]![mysubform CONTROL Name].Form.Requery
    LVL 1

    Expert Comment

    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:



    Author Closing Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
    An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now