Restrict entry to a text box

  • Thread starter Thread starter Opal
  • Start date Start date
O

Opal

I have a form bound to a table. When entries are made to the form, I
want
only values that are multiples of 5 input into the table. Anything
that is
not a multiple of 5 should come up with a warning and not allow the
user
to go any further in the form.

I was trying the following in the Validation rule in the properties of
the text box:

=DLookUp("[PointValue]","[Point]")

but it will not work. It will allow a value of 5, but not of 10 or
15....etc

The point table has values from 5 to 100 in multiples of 5.

Does anyone have any suggestions as to how I can accomplish this?
 
Opal said:
I have a form bound to a table. When entries are made to the form, I
want
only values that are multiples of 5 input into the table. Anything
that is
not a multiple of 5 should come up with a warning and not allow the
user
to go any further in the form.

I was trying the following in the Validation rule in the properties of
the text box:

=DLookUp("[PointValue]","[Point]")

but it will not work. It will allow a value of 5, but not of 10 or
15....etc

The point table has values from 5 to 100 in multiples of 5.

Does anyone have any suggestions as to how I can accomplish this?


You can use a validation rule like [Text0] Mod 5=0

Or you can use the form's BeforeUpdate event with a similar
test.
 
Opal said:
I have a form bound to a table.  When entries are made to the form, I
want
only values that are multiples of 5 input into the table.  Anything
that is
not a multiple of 5 should come up with a warning and not allow the
user
to go any further in the form.
I was trying the following in the Validation rule in the properties of
the text box:
=DLookUp("[PointValue]","[Point]")

but it will not work.  It will allow a value of 5, but not of 10 or
15....etc
The point table has values from 5 to 100 in multiples of 5.
Does anyone have any suggestions as to how I can accomplish this?

You can use a validation rule like  [Text0] Mod 5=0

Or you can use the form's BeforeUpdate event with a similar
test.

--
Marsh
MVP [MS Access]- Hide quoted text -

- Show quoted text -

Beautiful, thank you Marsh!
 
Back
Top