If I may, I would evaluate null or empty string in a function in a standard module. That way, you can call it from anywhere without having to re-write the same code umpteen times. There could be an issue with the enabling approach on AfterUpdate in that once enabled, they remain so if the control contents are deleted - unless you're going to test after every update and cycle them. To evaluate a control, I'd recommend something like this air code. I'm writing from memory:
Code:
Sub cmdRepairFilter_Click()
If IsNullEmpty (Me.myControl) Then
msgbox "Please supply a repair filter value."
Exit Sub
End If
'do repair filter stuff
End Sub
Public Function IsNullEmpty (ctl As Control)
IsNullEmpty = False
If IsNull(ctl) Or ctl = "" Then
IsNullEmpty = True
End If
End Function
I think that with this approach, you don't have to worry about enabling/disabling buttons and the extra code that comes with that.
P.S. - could you explain what this means?
even the trolling rude ones, they are the best.
Thanks.
Last edited by Micron; 11-12-2016 at 03:11 PM.
Reason: correction
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.