
Originally Posted by
Welshgasman
Surely a Select Case would be more appropriate?
What is a Select Case?
Also would you happen to know why these lines would interfere with disabling a text box?
KeyAscii = Asc(UCase(Chr(KeyAscii))) = Key Press Event
Me.txtName = UCase(Me.txtName) = After Update Event
These are both for the Me.txtName text box. I should also add that it will put a "0" in that field once it attempts to disable it using this:
Code:
If Me.CheckBox = True Then
Me.txtName.Enabled = False
Me.Dirty = False
Else
Me.txtName.Enabled = True
Me.Dirty = False
End If
So the original value will be replaced with a "0". In other words, if I had John Doe saved in the txtName field and I run the VBA to disable all the text boxes on the form, it will disable all text boxes except the txtName field and I think it's because of those uppercase lines of code because if I remove those lines, it will disable it.
However, I have another text box (Me.txtCompany) that has those uppercase lines of code for the same events and the code has no trouble disabling it. So it's a mystery.