Validation Rule at Table Level. (1 Viewer)

Local time
Today, 14:03
Joined
Mar 23, 2022
Messages
45
Hi Guys,

Please help me how to use Table Validation Rule to validate the following.

During Data Entry Ms. Access should validate that there should not be more than two participants from each country under the same category.

Can it be done under Table Validation Rule.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:33
Joined
May 7, 2009
Messages
19,226
you need to create Data Macro, particularly Before Change macro.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:33
Joined
May 7, 2009
Messages
19,226
upload your db with the table you need to validate.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:33
Joined
Feb 28, 2001
Messages
27,122
Hi Guys,

Please help me how to use Table Validation Rule to validate the following.

During Data Entry Ms. Access should validate that there should not be more than two participants from each country under the same category.

Can it be done under Table Validation Rule.

This is not a simple data validation, which usually relates only to the current record and not any other record. Looking at other records to determine whether a data constraint applies across multiple records requires some code or, as arnelgp suggests, a macro of some kind.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:33
Joined
May 7, 2009
Messages
19,226
open table1 in design view and see the macro on Before change.
open table1 to enter data. try to input duplicate country and category.
 

Attachments

  • TableValidation.accdb
    512 KB · Views: 161
Local time
Today, 14:03
Joined
Mar 23, 2022
Messages
45
open table1 in design view and see the macro on Before change.
open table1 to enter data. try to input duplicate country and category.
The solution above is for duplicate entry.

But I need to check for 2 similar entry with the same country and under the same category.

Only two participants from the same country can participate in the same category.

aaa-USA-Swimming
bbb-USA-Swimming
ccc-UK-Chess
ddd-UK-Chess
 
Last edited:
Local time
Today, 14:03
Joined
Mar 23, 2022
Messages
45
The solution above is for duplicate entry.

But I need to check for 2 similar entry with the same country and under the same category.

Only two participants from the same country can participate in the same category.

aaa-USA-Swimming
bbb-USA-Swimming
ccc-UK-Chess
ddd-UK-Chess
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:33
Joined
May 7, 2009
Messages
19,226
here add records to table1 again.
 

Attachments

  • TableValidation.accdb
    512 KB · Views: 217

Users who are viewing this thread

Top Bottom