Hey,
I have a textbox on my form that manually has values entered based on a Truth Table however, I want to be able to override these fixed values and then input my own if applicable.
I have an override button that activates the manual entry into these boxes however, I'm having trouble on writing code to only allow the following values to be entered: 1.1 or 1.2 or 2.1 or 2.2 or 3 or 4.
If the values are entered incorrectly, I want the value to automatically reset to "". Is this possible?
I have a textbox on my form that manually has values entered based on a Truth Table however, I want to be able to override these fixed values and then input my own if applicable.
I have an override button that activates the manual entry into these boxes however, I'm having trouble on writing code to only allow the following values to be entered: 1.1 or 1.2 or 2.1 or 2.2 or 3 or 4.
If the values are entered incorrectly, I want the value to automatically reset to "". Is this possible?
Code:
Private Sub tBox1_Change()
'affects values
With Me
'With .tBox1
'when override only allow 1.1, 1.2, 2.1, 2.2, 3 & 4 as manual entries last term ensure code is not restricted eg code can enter N/A
'values entered outwith the allowed range will be cleared
If Not (.Value = "1.1" Or .Value = "1.2" Or .Value = "2.1" Or .Value = "2.2" Or .Value = "3" Or .Value = "4") And Me.Override.Value Then .Value = ""
End With
Call ColourCoding(.tBox1)
End With
End Sub