I have a form(fAddUsers) in my database. It is continue form for data
entry. Some fields are required fields. Some are optional fields.
There is 1 particular filed(TokenExpirationDate)on the form which is
depended on the other field(TokenID)whether it is blank or not. If
the "TokenID" field is blank, the "TokenExpirationDate" field can be
blank also. But if the "TokenID" field is not blank or null, the
"TokenExpirationDate" field must be entered before the users attempts
to enter data into next record.

The task that I want to perform on the form is as follows:

1. Check to see if mandatory fields are empty, if they are display
message to users about which fields need to be completed;
2. Check to see if "TokenID" field is blank or null, if it is
blank or null, user can skip "TokenExpirationDate" field and allows to
enter data into next new record. If the "TokenID" field is not null,
the "TokeExpirationDate" must be entered before entering data into new
record.

Could someone please help me to solve this problem? I thank you for
your kind assistance.

Write your code in the Form_BeforeUpdate event, and set Cancel to True
if not valid.

-Tom.

I have a form(fAddUsers) in my database. It is continue form for dataentry. Some fields are required fields. Some are optional fields.There is 1 particular filed(TokenExpirationDate)on the form which isdepended on the other field(TokenID)whether it is blank or not. Ifthe "TokenID" field is blank, the "TokenExpirationDate" field can beblank also. But if the "TokenID" field is not blank or null, the"TokenExpirationDate" field must be entered before the users attemptsto enter data into next record.

The task that I want to perform on the form is as follows:

1. Check to see if mandatory fields are empty, if they are displaymessage to users about which fields need to be completed;
2. Check to see if "TokenID" field is blank or null, if it isblank or null, user can skip "TokenExpirationDate" field and allows toenter data into next new record. If the "TokenID" field is not null,the "TokeExpirationDate" must be entered before entering data into newrecord.

Could someone please help me to solve this problem? I thank you foryour kind assistance.

"A record validation rule controls when an entire record can be saved.
Unlike field validation rules, record validation rules can refer to
other fields. This makes them useful when you want to compare values
from different fields in a table. You define a record validation rule
in a table." - MS Access Help

For example, I need to ensure that:
- if student completed full qualification (Achievement status]=1), a
date, when s/he achieved entered;
- if student completed some modules of qualification (Achievement
status]=2), a date, when s/he achieved and number of modules/units are
entered;
- if student didn't achieve, neither data, no number of modules/units
are required.
To enforce the above rules on users' input, I entered into Table's
properties:
Validation Rule:
([Achievement status]=1 And Not IsNull([When])) Or ([Achievement
status]=2 And Not IsNull([When]) And [Units No]>0) Or ([Achievement
status]=0) Or ([Achievement status]=3)
and Validation Text:
If you entered that the student achieved on this qualification, or
partially achieved, you have to enter the date. Also, if partially
achieved, you should enter a number of units completed.
Hope this will help.
Galinaqs*******@hotmail.com (qs*******@hotmail.com) wrote in message news:<ed**************************@posting.google. com>...

I have a form(fAddUsers) in my database. It is continue form for data entry. Some fields are required fields. Some are optional fields. There is 1 particular filed(TokenExpirationDate)on the form which is depended on the other field(TokenID)whether it is blank or not. If the "TokenID" field is blank, the "TokenExpirationDate" field can be blank also. But if the "TokenID" field is not blank or null, the "TokenExpirationDate" field must be entered before the users attempts to enter data into next record.

The task that I want to perform on the form is as follows:

1. Check to see if mandatory fields are empty, if they are display message to users about which fields need to be completed;
2. Check to see if "TokenID" field is blank or null, if it is blank or null, user can skip "TokenExpirationDate" field and allows to enter data into next new record. If the "TokenID" field is not null, the "TokeExpirationDate" must be entered before entering data into new record.

Could someone please help me to solve this problem? I thank you for your kind assistance.