bballhermit
Registered User.
- Local time
- Today, 04:47
- Joined
- Oct 14, 2010
- Messages
- 40
I have a form with a list box containing employee information. I have a button on the form that runs a command which deletes the currently selected employee. When no record is selected in the list box, I want the delete button to be disabled. To do this, I have the following function called in the form's "On Current" event. However, after running the delete command, and returning to the form from the msgbox that confirms the delete, no record is selected and the delete button is still enabled.
Is there a better way to do this? Or what am I doing wrong? Thanks.
Is there a better way to do this? Or what am I doing wrong? Thanks.
Code:
'Update Enabled Delete Button Based on Employee Selected
Private Function UpdateEnableDelete()
If IsNull(Forms!fmnuEmployees!lstEmployees) = False Then
Me.cmdDelete.Enabled = True
Else
Me.cmdDelete.Enabled = False
End If
End Function