I have a line of code that does not trigger for the condition set in an if statement.
The textbox associated is the Date Effective textbox, which is empty for the record being displayed.
![Name: 2021-08-08_12-51-12.jpg
Views: 45
Size: 41.3 KB]()
I have observed this line of code running numerous times and have been able to note that when the textbox is not filled the Edit button (btnEdit) is not disabled (as it should be). However if I display a record where the field is filled, btnEdit is still not disabled.
I have checked in all of the associated forms(Classes) and have not found a place where that might be overridden.
Is there something, hopefully obvious, that I am doing wrong? I use this If statement frequently for a number of branches and have never experienced this, except for this particular line in this particular form.
Code:
If Not String.IsNullOrWhiteSpace(txtEffective.Text) Then btnEdit.Enabled = False Else btnEdit.Enabled = True
I have observed this line of code running numerous times and have been able to note that when the textbox is not filled the Edit button (btnEdit) is not disabled (as it should be). However if I display a record where the field is filled, btnEdit is still not disabled.
I have checked in all of the associated forms(Classes) and have not found a place where that might be overridden.
Is there something, hopefully obvious, that I am doing wrong? I use this If statement frequently for a number of branches and have never experienced this, except for this particular line in this particular form.