
Originally Posted by
ZMac
I have a table set up with an AMOUNT field (Double - Standard - Decimal Place 2).
By mistake, I entered 36,33 instead of 36.22. Access updated the field as 3,633.00.
Is there a way to format the table field so that this entry error won't be accepted?
There are ways to validate but the one thing that you have to be careful of, is depending on how you do this, or what values you select, it can possibly not let someone enter a valid value.
So, perhaps you might want just a warning message box to come up if a value over a certain amount is entered. That can be in that control's Before Update event:
Code:
Private Sub ControlNameHere_BeforeUpdate(Cancel As Integer)
If Me.ControlNameHere > 1000 Then ' I used 1000 but you can determine the amount
If MsgBox("You entered an amount over $1,000. Is that correct?", vbQuestion + vbYesNo, "Warning") = vbNo Then
Cancel = True
Me.ControlNameHere.Undo
End If
End If
End Sub