Multi-Select Listbox, ClearAll, and AfterUpdate

C

croy

On a form used for launching a report, a multi-select
listbox is used like a filter, limiting the results that go
to the report. The AfterUpdate property for the listbox has
code to make some command buttons on the form enabled, and
some not enabled. This all works very nicely.

Near the listbox, I placed a couple of command buttons to
make it easier for the user to "select all" or "clear all",
and that works also (thanks to Allen Browne for that code).

The problem I've having is that using the "ClearAll" button
doesn't seem to cause the AfterUpdate event for the listbox
to fire, resulting in those other command buttons to remain
enabled or disabled, when I want that status to change
because of the "ClearAll" command.

Would anyone care to offer a way to get the AfterUpdate
event to fire when using the ClearAll code?
 
D

Douglas J. Steele

Simply call the AfterUpdate event from your ClearAll event's code:

Private Sub ClearAll_Click()

' existing code here...

Call MyListbox_AfterUpdate

End Sub
 
C

croy

Simply call the AfterUpdate event from your ClearAll event's code:

Private Sub ClearAll_Click()

' existing code here...

Call MyListbox_AfterUpdate

End Sub


Perfect! Thanks Douglas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top