Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Change the field age to plastic.
Change the field age to plastic.
In the validity rules of tables, two or more columns of values cannot be used to constrain the validity of data.

Therefore, it is impossible to limit the working age to be greater than 18 years by setting table validity rules.

If you want to restrict input, you can set the entry form of this table and add the following code in the event procedure before updating the form:

The following is the judgment of the expiration period 18 years old (in line with the labor law), and you can modify the conditions you want.

If Year([ date of work ])-Year([ date of birth ]) > = 18 And Month([ date of work ])-Month([ date of birth ]) > = 0 And Day([ date of work ])-Day([ date of birth ]) > = 0.

If you are 18 years old, add a new record.

other

If the age is below 18, you will be prompted to terminate the record update.

MsgBox "must be 18 years old when you join the work! Please check and re-enter ... ",16+0+4096," Error terminated "

Cancel = 1

If ... it will be over.