• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 378
  • Last Modified:

Requery a List Box when a checkbox changes on a Form

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()
[Forms]![frmJCJobStatusCurrent].[Form].[ckbxIncludeClosedJobs].[Requery]

End Sub


It does not work and I have to click Refresh All to get it to work.
0
wlwebb
Asked:
wlwebb
1 Solution
 
Dale FyeCommented:
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()

    me.lstJobs.Requery

End Sub
0
 
wlwebbAuthor Commented:
Perfect!  That was the trick.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now