take action on entry into bound textbox B4 underlying validation

wware

Registered User.
Local time
Today, 11:49
Joined
Feb 26, 2007
Messages
19
Textbox is bound to underlying column in a table which is number datatype. This is appropriate.

Now user want option of entering "NA" into this textbox which would set the value of this bound textbox and also another bound textbox to 0. In other words, entering "NA" in this textbox sets two underlying columns to 0 for data entry efficiency.

I don't know what event in which to evaluate the value in the bound textbox BEFORE the underlying column's limitation kicks in and gives its error message about not accepting a nonnumeric value.


If Me.Textq1.Value = "NA" Then
Me.Textq1.Value = 0
Me.Textp1.Value = 0
End If

Do I need to do something with keypress() to see if they are typing an "N"?

Any help appreciated.
 
Well, I guess I have something functional using KeyUp. See below. As is often the case, describing the problem to other(s) can result in my own mental breakthrough. If anyone can offer further advice/warning, I'd still appreciate it.

Private Sub Textq1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 78 Then
Me.Textq1.Value = 0
Me.Textp1.Value = 0
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom