Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a table that contains 3 columns:

ID            Auto increment
Username      Text
Userclass     Number

I want to give every user a userclass – this could be a number from 1 to 20, but I only want 20 users to have the same userclass.

How would I do this in Microsoft Access?

On a similar note, how would I limit the number of rows in an Access table to only 500?

share|improve this question
add comment

2 Answers

As far as I know there is no way to enforce these types of constraints in the table design. The builtin table storage has a very limited support of constraints, and no support for triggers. You will have to build some application logic.

share|improve this answer
add comment

The table is the data holder. There probably isn't much you can do with restricting the table. You will have far more options using VBA with the user form. Not knowing what version you have and how your form is designed, I am limited in offering advice.

VBA will allow you to use events to trigger functions which can only allow the choice from a list of what userclass iavailablele. It can also give you the ability to check the number of records in the table and stop if the maximum is reached.

If you are not familiar with VBA, there are numerous free resources available via the Internet to learn how to use it.

share|improve this answer
1  
thank you ..i just wanted to know how this could be done and if it is possible in any way to do it directly in the table without the need to program anything ..thanks again –  lebhero Feb 29 '12 at 20:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.