Saving a record from form bypassing mandatory fill fields??

S

Stan Smith

Hi,
I have designed a telephone call logging form on which some fields (e.g
location, gender, subject) HAVE to be completed but there is also a tickbox
for prematurely terminated calls e.g. hang-ups.
Currently, when getting a hang-up, the operator has to work their way thru
the mandatory fields inserting Unknown to allow the record to be saved.
Is there a way that when the "Terminated box is ticked" the record can be
automatically saved without the mandatory fields being completed??

My limited knowledge of Access is now really being stretched so any advice
would be really welcomed
MTIA

Stan
 
A

Allen Browne

Use the Validation Rule of the table, instead of the Required property of
the fields.

1. Open the table in design view.

2. Set the Required property to No for all these fields.

3. Open the Properties box (View menu).

4. Beside the Validation Rule in the Properties box, enter something like
this:
([Terminated]) OR (([Location] Is Not Null) AND
([Gender] Is Not Null) AND ([Subject] Is Not Null))

The rule is satisfied if the Terminated field is True.
Otherwise the only way the rule can be satisfied is if the other fields are
not null.

Be sure to use the table's validation rule (in the Properties box), not the
rule for a field (in the lower pane of table design view).

It is also possible to use the BeforeUpdate event of the Form, but the table
is better as the rule is enforced at engine level (e.g. even if records are
not added through that form).
 
S

Stan Smith

Allen,
Many thanks for that - will give it a try - must admit I am at the bottom of
the learning curve which seems to be vertical and have found you MVP's to be
a major asset of these newsgroups especially how fast you respond.
Is there a site for giving "pats on the back" to MVPs??
Thanks again
Stan


Allen Browne said:
Use the Validation Rule of the table, instead of the Required property of
the fields.

1. Open the table in design view.

2. Set the Required property to No for all these fields.

3. Open the Properties box (View menu).

4. Beside the Validation Rule in the Properties box, enter something like
this:
([Terminated]) OR (([Location] Is Not Null) AND
([Gender] Is Not Null) AND ([Subject] Is Not Null))

The rule is satisfied if the Terminated field is True.
Otherwise the only way the rule can be satisfied is if the other fields are
not null.

Be sure to use the table's validation rule (in the Properties box), not the
rule for a field (in the lower pane of table design view).

It is also possible to use the BeforeUpdate event of the Form, but the table
is better as the rule is enforced at engine level (e.g. even if records are
not added through that form).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Stan Smith said:
I have designed a telephone call logging form on which some fields (e.g
location, gender, subject) HAVE to be completed but there is also a
tickbox
for prematurely terminated calls e.g. hang-ups.
Currently, when getting a hang-up, the operator has to work their way
thru
the mandatory fields inserting Unknown to allow the record to be saved.
Is there a way that when the "Terminated box is ticked" the record can be
automatically saved without the mandatory fields being completed??

My limited knowledge of Access is now really being stretched so any advice
would be really welcomed
MTIA

Stan
 
A

Allen Browne

Appreciated.

Yes, there is a huge amount to learn about Access.

Those who respond (MVPs and others) are glad to be part of the process.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Stan Smith said:
Allen,
Many thanks for that - will give it a try - must admit I am at the bottom
of
the learning curve which seems to be vertical and have found you MVP's to
be
a major asset of these newsgroups especially how fast you respond.
Is there a site for giving "pats on the back" to MVPs??
Thanks again
Stan


Allen Browne said:
Use the Validation Rule of the table, instead of the Required property of
the fields.

1. Open the table in design view.

2. Set the Required property to No for all these fields.

3. Open the Properties box (View menu).

4. Beside the Validation Rule in the Properties box, enter something like
this:
([Terminated]) OR (([Location] Is Not Null) AND
([Gender] Is Not Null) AND ([Subject] Is Not Null))

The rule is satisfied if the Terminated field is True.
Otherwise the only way the rule can be satisfied is if the other fields are
not null.

Be sure to use the table's validation rule (in the Properties box), not the
rule for a field (in the lower pane of table design view).

It is also possible to use the BeforeUpdate event of the Form, but the table
is better as the rule is enforced at engine level (e.g. even if records are
not added through that form).


Stan Smith said:
I have designed a telephone call logging form on which some fields (e.g
location, gender, subject) HAVE to be completed but there is also a
tickbox
for prematurely terminated calls e.g. hang-ups.
Currently, when getting a hang-up, the operator has to work their way
thru
the mandatory fields inserting Unknown to allow the record to be saved.
Is there a way that when the "Terminated box is ticked" the record can be
automatically saved without the mandatory fields being completed??

My limited knowledge of Access is now really being stretched so any advice
would be really welcomed
MTIA

Stan
 
Top