Hi guys,
I have a form where the user can multiple check various options (medical specialities) dynamically created from a table, and eventually in a later moment edit the choices adding or unchecking options.
These options are not fixed, meaninig that the number of possible choices can grow or shrink depending on necessities (let's say a new department has been added or cancelled).
For this reason I cannot define some logical fields in the 'main' table, but I have to create a separate table to store the choices.
Now my question:
when the user edit his choices, what is the best approach to show the ones already chosen checked and the other unchecked ?
My first impulse was to display the one checked first, selecting from the 'child' table, and then using a "SELECT NOT IN (SELECT)" to display the others unchecked from the specialties table. Let's say, for the sake of clarity :
Any idea of a better way ??
Thanks !!
I have a form where the user can multiple check various options (medical specialities) dynamically created from a table, and eventually in a later moment edit the choices adding or unchecking options.
These options are not fixed, meaninig that the number of possible choices can grow or shrink depending on necessities (let's say a new department has been added or cancelled).
For this reason I cannot define some logical fields in the 'main' table, but I have to create a separate table to store the choices.
Now my question:
when the user edit his choices, what is the best approach to show the ones already chosen checked and the other unchecked ?
My first impulse was to display the one checked first, selecting from the 'child' table, and then using a "SELECT NOT IN (SELECT)" to display the others unchecked from the specialties table. Let's say, for the sake of clarity :
Code:
fisrtSQL="SELECT specialtyID FROM Choices WHERE id=" & id
WHILE ....
[i] create the checked checkboxes[/i]
WEND
secondSQL="SELECT * FROM Specialties WHERE specialtyID NOT IN ("& firstSQL& ")"
WHILE ....
[i] create the unchecked checkboxes[/i]
WEND
Thanks !!