Hi, Is there a way to limit how many records can be stored in a table? I have a users table and I want to be able to limit the table so that only 5 users can be entered.
Thanks,
whill1
I would have though not with the table itself, but perhaps PHV's idea, using a byte field and a validation rule of <5 (0-4), or here's another (clumsy) workaround.
Create an extra table, with, for instance a numeric primary key, and a text field. Enter
1 - USER1
2 - USER2
3 - USER3
4 - USER4
5 - USER5
Then relate it one to one with your user table. I e, primary key of the user table, also numeric, then with both having unique indexes, you shouldn't be able to enter more than the same number of records in your table.
Hi, Hey Roy-Vidar I tried that and it worked. The only problem is that when I try to add a record >5 I get a generic message that says "You cannot add or change a record because a related record is required in table 'Limiter'"
I have been trying to replace this with a MsgBox that says "this database is limited to 5 users"
I've written the code for the MSgBox but I cannot figure out where to put it so that it will get caught.
I've tried The OnChange, LostFocus, AfterUpdate, and other events on the form and nothing seems to work.
Thanks again,
whill1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.