
Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Actually what i want is to prevent user entering measurements that is not in
wanted format (number X number)
if user insert (10 X 20)==>correct but (10mm X 2mm)==>errormessage and stop
the data entries
Any CODES solution?
Thanks advance
Kennykee
> >I got a measurement(measurements are without Unit,mm,cm)
> >
[quoted text clipped - 6 lines]
>
> The best solution would be to store this in 6 separate numeric fields.
Rick Brandt - 06 May 2005 03:02 GMT
> Actually what i want is to prevent user entering measurements that is not in
> wanted format (number X number)
> if user insert (10 X 20)==>correct but (10mm X 2mm)==>errormessage and stop
> the data entries
>
> Any CODES solution?
I suppose an Input Mask that automatically embedded the Xs would work, but it's
just a bad way to store the data. A field should have exactly one piece of
information in it not six.
A Coded solution might be complicated. It would be simple to disallow any
character that is not a digit, a space, or an 'X', but that wouldn't prevent an
entry like 1XX3 or X12X.
If I absolutely had to store data like this I would use an InputMask.

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Tim Ferguson - 06 May 2005 17:40 GMT
> Actually what i want is to prevent user entering measurements that is
> not in wanted format (number X number)
Try this as a validation rule:
IS NULL OR
LIKE "[0-9][0-9] X [0-9][0-9]" OR
LIKE "[0-9] X [0-9][0-9]" OR
LIKE "[0-9][0-9] X [0-9]" OR
LIKE "[0-9] X [0-9]"
all on line. This will allow one- or two- digit numbers with an X in the
middle. If you need more complex regular expressions, then you are
probably beyond what a check constraint can do. You can do anything in a
BeforeUpdate event, however, including using the real RegExp object for
very advanced pattern matching. That of course means you have to limit
your users to using the form.
Your best approach may be to use best-you-can-manage with the validation
rule as a fall-back for the proper user-friendly one on the control.
If the format is really vital, I'd move the two numbers into two numeric
fields and do all the formatting in the query.
Hope that helps
Tim F