Default Values

J

Jody

I am needing to create a table/form that will have default values that will
automatically generate, that can be easily overridden but will give an error
message if the data does not comply.

Example

A group home has 4 clients, with 2 staff members on duty, I am needing to
have ratio's of staff to clients for every 15 minutes. The default for this
time would be 1/2 with 2 staff members. But it needs to override it if 1
staff member takes 1 client out their ratio would be 1/1 and the others 1/3.
I need something also to say if whether the ratios and staff don't comply .
 
B

Brendan Reynolds

I couldn't really follow your question, but in general terms, default values
can always be over-ridden and do not force any validation, you need to use a
validation rule in addition to your default value. In an MDB you can have
field level validation rules, you can also create a table-level validation
rule that can do some things that a field-level validation rule can't do,
such as comparing the input with the value of other fields in the table.
You'll find the field-level validation rule right under the default value in
table design view. To create a table-level validation rule, choose
'Properties' from the 'View' menu in table design view. And when your
validation requirements exceed the capabilities of field and table level
validation rules, you can use macros or VBA code in the BeforeUpdate event
procedures of forms and form controls to validate input.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Top