I have two tables: ContactLists and ContactListDetails. They are in a one-to-many relationship. Both are user created. A user inputs via a form:
OperationsGroup
ProjectName
Listname
And via a button generates an auto number ListID . In a similar fashion ContactIDs are added to the ContactListDetails table.
This table is further restricted through an index (ContactListIndex)where ListName,OperationsGroup, ProjectName are a unique row. ie an OperationsGroup can have more than one ProjectName. An OperationsGroup, ProjectName combination can have multiple Listnames. This same combination however CANNOT have duplicate Listnames although the table can have duplicate Listnames with other combinations of OperationsGroup and ProjectName.
I would like the user to assign a listname to be their default but make sure that no combination of OperationsGroup and ProjectName can have more than one ListName assigned as default.
The Table might look something like this
OperationsGroup[tab]ProjectName[tab]ListName[tab]Default
1[tab][tab][tab][tab][tab][tab]alpha[tab][tab][tab][tab]Bob[tab][tab][tab]True
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Bob
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Jim
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Ann[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]bravo[tab][tab][tab][tab]Ann[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]gamma[tab][tab][tab]Bob[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]gamma[tab][tab][tab]Sal[tab][tab][tab]
I am looking for a method where if OperatonsGroup and ProjectName matched and contained multiple rows with different Listnames that only one(1) row would be allowed to be checked as the default.
This is a multiple user application and it needs to be dynamic and user controlled. The default designation would determine which contact list was printed in a report. They would also have the option of changing from the default list to their preferred list.
Should I consider using a third table as a Defaults Table containing the OperationsGroup, ProjectName and ListName?
If that combination of fields were restricted to being unique then when a user designated a list to be the default I could programatically lookup those field values and if found delete that row or if NOT found add the new row? Maybe I can do that in the existing table already and just check or uncheck the default field based on the results?
I have seen other applications where user preferences are set as defaults but have never built any such item.
Your thoughts and suggestions please?
OperationsGroup
ProjectName
Listname
And via a button generates an auto number ListID . In a similar fashion ContactIDs are added to the ContactListDetails table.
This table is further restricted through an index (ContactListIndex)where ListName,OperationsGroup, ProjectName are a unique row. ie an OperationsGroup can have more than one ProjectName. An OperationsGroup, ProjectName combination can have multiple Listnames. This same combination however CANNOT have duplicate Listnames although the table can have duplicate Listnames with other combinations of OperationsGroup and ProjectName.
I would like the user to assign a listname to be their default but make sure that no combination of OperationsGroup and ProjectName can have more than one ListName assigned as default.
The Table might look something like this
OperationsGroup[tab]ProjectName[tab]ListName[tab]Default
1[tab][tab][tab][tab][tab][tab]alpha[tab][tab][tab][tab]Bob[tab][tab][tab]True
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Bob
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Jim
2[tab][tab][tab][tab][tab][tab]baker[tab][tab][tab][tab]Ann[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]bravo[tab][tab][tab][tab]Ann[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]gamma[tab][tab][tab]Bob[tab][tab][tab]True
3[tab][tab][tab][tab][tab][tab]gamma[tab][tab][tab]Sal[tab][tab][tab]
I am looking for a method where if OperatonsGroup and ProjectName matched and contained multiple rows with different Listnames that only one(1) row would be allowed to be checked as the default.
This is a multiple user application and it needs to be dynamic and user controlled. The default designation would determine which contact list was printed in a report. They would also have the option of changing from the default list to their preferred list.
Should I consider using a third table as a Defaults Table containing the OperationsGroup, ProjectName and ListName?
If that combination of fields were restricted to being unique then when a user designated a list to be the default I could programatically lookup those field values and if found delete that row or if NOT found add the new row? Maybe I can do that in the existing table already and just check or uncheck the default field based on the results?
I have seen other applications where user preferences are set as defaults but have never built any such item.
Your thoughts and suggestions please?