G
graeme34 via AccessMonster.com
Hi
I havre a function that returns a False if the Order Number entered in a
textbox control is not numeric. But it is creating a small glitch in that I
have to press Ok twice to clear the MsgBox.
The code is as follows:
Private Function TestOrderValue() As Boolean
TestOrderValue = True
If IsNumeric(Me!txtOrderNumberChoice) Then
lngOrderNum = Me!txtOrderNumberChoice
Else
TestOrderValue = False
MsgBox "Sorry, the Order Number has to be a numeric value!", _
, "NUMERIC VALUE REQUIRED!"
Me!txtOrderNumberChoice.SetFocus
End If
End Function
The in the calling procedure I have
If TestOrderValue = False Then Exit Sub
Is there a way to prevevnt the user having to click Ok twice??
I havre a function that returns a False if the Order Number entered in a
textbox control is not numeric. But it is creating a small glitch in that I
have to press Ok twice to clear the MsgBox.
The code is as follows:
Private Function TestOrderValue() As Boolean
TestOrderValue = True
If IsNumeric(Me!txtOrderNumberChoice) Then
lngOrderNum = Me!txtOrderNumberChoice
Else
TestOrderValue = False
MsgBox "Sorry, the Order Number has to be a numeric value!", _
, "NUMERIC VALUE REQUIRED!"
Me!txtOrderNumberChoice.SetFocus
End If
End Function
The in the calling procedure I have
If TestOrderValue = False Then Exit Sub
Is there a way to prevevnt the user having to click Ok twice??