limit size of integer in number field on form - .adp

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

I have a quantity per field set up in my SQL Server file (adp project)
as precision 11 scale 5. This means the largest number I can store is
999999.99999 . I have a subform that this field is entered on
(datasheet view) and if a user keys in a number that is 7 digits long
(one longer than what is allowed) I get the error "multiple step
operation generated errors". I can trap for this error in the forms
On Error event but it's just the generic error 2757 which covers a lot
more errors than mine. And the control.value doesn't contain what was
keyed in, it just has the old value so I can't even test for what
field is in error. What I really need is a way to limit the size of
the number they key in. Is there a way to do that w/o triggering the
dreaded 2757 error?

Thanks, Brian
 
What happens if you set the Validation Rule of your text box to:
< 1000000

You can set the Validation Text to whatever message you want.
 
What happens if you set the Validation Rule of your text box to:
< 1000000

You can set the Validation Text to whatever message you want.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.







- Show quoted text -

I tried that but it the 2757 error jumps in before it gets to that
rule. If I put in a rule like < 800000 and enter a number larger than
that the rule kicks in just fine (as long as it's 6 digits). So it
seems that the field "knows" somehow that it shouldn't take a 7 digit
number and throws the Form On Error event. If I try to enter more
than 5 digits in the decimal side of the number it lops off any extra
digits, so that side of the number works OK, it's just the integer
side of the number that's giving me problems. Maybe it's a problem
with Access 2k projects?

If there is no way to limit the number of integers then the only
"solution" I can think of is to redefine all my decimal fields in SQL
Server as precision of 38 and then limit what they can enter via the
validation rule. Seems like a huge waste of space, hopefully there is
a better solution than that.

Would an input mask do the trick?

Brian
 
Back
Top