[RESOLVED] Limit Textbox To 3 Decimal Places
I need the user to be limited to only three places after the decimal.
I tried the following, but they all failed:
FormatNumber([NetAcres], 3) *Doesnt work because a user can not enter 3,001.22 due to precision errors.
I set the textbox properties to 3 decimals. *Doesn't work because the user can still enter as many decimal places as they want
I set the field properties to 3 decimals. *Doesn't work because the user can still enter as many decimal places as they want
Re: Limit Textbox To 3 Decimal Places
Resolved:
In design view of my table, I setup a validation rule for my field.
Round([Field],3)
Then I replaced the default error message with this, in my actual form.
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 3317
MsgBox "This field is limited to three decimal places."
Case Else
End Select
Response = acDataErrContinue
End Sub
I setup a case statement, in the event i ever need to append another response.