help with data validation or rule

  • Thread starter Thread starter DumUSER
  • Start date Start date
D

DumUSER

I have Two tables one call AUTHOR and CATALOGUE.



AUTHOR TABLE has the following filed:



AuthorID- auto number

Fnanm

Sname

Title - mr, dr



CATALOGUE Table



AuthorID - is linked to the above

BookTitle-

ISBN-

Yearpub

Best4Book- Yes, NO



My problem is I want the authors to submit many books as possible. But I
want to restrict them from submitting only 4 books with condition YES. So if
they have already submitted more then 4 books with YES, they can still
submit book but not as there best books. Is that possible? any advise is
welcome?



DamUser, UK
 
This would be fairly easy to do in a form. In the checkbox's BeforeUpdate
event, check to see how many they have selected the checkbox for and give an
error message (msgbox) if it exceeds 4. To check the count, use the DCount
function in the BeforeUpdate event. You could even ask them if they would
like to review the previous Yes selections to see if they wanted to change
one of them then if they do, pop-up a form with the 4 previously selected
Yes entries. To cancel the selection of Yes, you would set Cancel=True then
Me.chkMycheckbox.Undo in the BeforeUpdate event.
 
Back
Top