Validate the number of checkboxes that can be true

Joined
Mar 17, 2015
Messages
1
Reaction score
0
Hi, I was wondering if anyone could help me. I have a form that contains a maximum of 20 records at a time. Each record has a yes/no field, but I want to limit the number of yes/no that can be ticked. At the moment, I have an IIF calculated field named SelectValues that assigns a 1 or a 0 depending on whether the yes / no is ticked or not. I then have a a calculated control that sums the number of SelectValues.

I have tried to code this through VBA without success. I used an IF function within the code builder for the before update event in the yes/no field property (see below).

if(text18>5) then
msgbox(....)
Cancel = True

Am I on the right lines or is there another way of doing this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top