With this macro, I can activate or deactivate a List Box using a button.
How can I modify it to deactivate the List Box when the content of a text field is different from “D”?
Thank you
Sub S_deactivate_Listbox(event)
oButton = event.source.model
oForm = oButton.Parent
oLstbox = oForm.getbyname("lst_FK_ID_P")
if oButton.Label ="activate Listbox" then
oButton.Label = "deactivate Listbox"
oLstbox.Enabled = true
else
oButton.Label = "activate Listbox"
oLstbox.Enabled = false
endif
End Sub