Topic: Restrict field entry to one per user

Here's what I have:
A User Table
A Housing Table linked to the User table.
A field in the Housing table with a choice of residence of Full Time, Part Time or Investment
-
I would like to make it so that for a specific User, they can only have one Full Time Residence.
They might have a part time cabin and some rental houses, but only one can be their Full Time Residence.
-
I'm thinking that an IF statement looking for a Full Time entry in the users Housing records would be used to allow or disallow a second Full Time entry.
-
I have a rough idea about the code but I'm not at the level yet where I can write it myself.
-
As always, your help will be appreciated.
Thanks, Frank

Re: Restrict field entry to one per user

Here's a sample. Hope it gives you an idea.

Post's attachments

Attachment icon frank_housing.zip 496.49 kb, 199 downloads since 2020-10-24 

brian

3 (edited by derek 2020-10-25 00:50:51)

Re: Restrict field entry to one per user

Hi Frank, Hi Brian,
Another option, using Brian's example (thanks Brian), would be to add calculated fields to show how many of each residence type the user has.  Then take the value in the relevant 'full time residence' cell and, if it's 1, then don't show 'full time' in the combobox drop-down (and vice versa).
I've shown it for all residence types but you could choose to do it just for the 'full time' type -  and if you didn't actually want to see the 'full time' column in the grid at all, you could always hide it.
Derek.

Post's attachments

Attachment icon frank_housing option c.zip 338.51 kb, 190 downloads since 2020-10-24 

Re: Restrict field entry to one per user

Gentlemen,
Thank you for the solutions you have provided.
-
I'll be going through them to see how I can add a solution to my existing code.
-
As usual, you guys are great.
Thanks, Frank