Requery a List Box when a checkbox changes on a Form

Posted on 2011-05-05
Last Modified: 2012-06-27
Hello again
Easy 500 points

Have a form that on the main form (has a sub from but the checkbox is on the main form) there is a Checkbox to either include or exclude "Closed" jobs.  When the checkbox changes I need my list box to update automatically.

In the checkboxes AfterUpdate statement I have

Private Sub ckbxIncludeClosedJobs_AfterUpdate()

End Sub

It does not work and I have to click Refresh All to get it to work.
Question by:wlwebb
    LVL 47

    Accepted Solution

    That is because you appear to be requerying the checkbox, and not the list.

    What is the SQL for the listboxes RowSource, and is the list on the main form, or in the subform?

    If the checkbox and the listbox are on the main form, then the syntax would be something like:

    Private Sub ckbxIncludeClosedJobs_AfterUpdate()


    End Sub

    Author Closing Comment

    Perfect!  That was the trick.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    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…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    759 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

    13 Experts available now in Live!

    Get 1:1 Help Now