|
-
Jul 16th, 2009, 01:16 PM
#1
Thread Starter
Fanatic Member
[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
-
Jul 16th, 2009, 02:21 PM
#2
Thread Starter
Fanatic Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|