Romio_1968
Member
- Local time
- Today, 19:37
- Joined
- Jan 11, 2023
- Messages
- 126
I have an unbound textbox, with format set to 'General Number', no decimals.
When a non numerical key is entered, the default error message pops up: "the value you entered isn't valid for this field"
To prohibit user for entering such values, i set an On Change event for the control
Instead of executing the MsgBox and do the roll back, the default Access error message pops up, and no rollback is executed, but a Cancel seems to be done (the non numerical value stays, highlighted)
What am I doing wrong?
RESOLUTION
___________________________________________________________________
Instead of testing Me.PrintYearStart.Value, i chaned it to Me.PrintYearStart.Text
The custom behavior is now triggered
(thank you, arnelgp)
When a non numerical key is entered, the default error message pops up: "the value you entered isn't valid for this field"
To prohibit user for entering such values, i set an On Change event for the control
Code:
Private Sub PrintYearStart_Change()
If Not IsNumeric(Me.PrintYearStart.Value) Then
MsgBox "Valoare incorecta!" & vbNewLine & vbNewLine & _
"Anul este un numar format din 4 cifre" & vbNewLine & _
"(Exemplu: 1968)", vbExclamation, "Atentie"
Me.PrintYearStart.Value = MinPrintYear
End If
End Sub
What am I doing wrong?
RESOLUTION
___________________________________________________________________
Instead of testing Me.PrintYearStart.Value, i chaned it to Me.PrintYearStart.Text
The custom behavior is now triggered
(thank you, arnelgp)
Last edited: