question on listbox

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

Hi,

I have a form with a listbox (lstNames) and a button (btnEdit) to edit name.
This button is disable when form is open to prevent use opening the
frmEditName unless user select a name in the lsitbox (lstNames). I want to
enable the button when the listbox is clicked/selected. How can I do that?

SF
 
Use AfterUpdate event of the listbox:

Private Sub lstNames_AfterUpdate()
Me.btnEdit.Enabled = (IsNull(Me.lstNames.Value) = False)
End Sub
 
Back
Top