P
Peter Hallett
A combo box is used to read surnames from a table. Unsurprisingly, a
significant number of the people featured in the table share surnames but
setting Unique Values to Yes, in the SQL, ensures that the names displayed in
the drop-down box are not duplicated. A secondary mechanism is then invoked
to select the desired individual in cases where a shared surname is chosen.
This all works well.
Each person listed in the table has a unique ID, which also needs to be
read. It appeared a good idea to include this field in the SQL and allocate
the value to another column in the combo box. The ID could then be read
directly as Name.Column(1), where the required surname appeared in
Name.Column(0) (or just Name). Immediately a second column was added,
however, the Unique Value setting failed to filter out duplicate surnames,
presumably for the reason that, with two fields involved, a difference in one
of them is sufficient to render the two records unique. However, name
duplication also occurs when Unique Records is set to Yes, which I find
rather puzzling.
It seems that I will be forced to change all the coding back to the original
version, where the combo box was used to select the name and this was then
used, rather inefficiently, to find the matching ID with a DLookup on the
same table. Apart from that, changing all the code is going to prove a bit
of a nuisance. Is there away of retaining the present arrangement?
significant number of the people featured in the table share surnames but
setting Unique Values to Yes, in the SQL, ensures that the names displayed in
the drop-down box are not duplicated. A secondary mechanism is then invoked
to select the desired individual in cases where a shared surname is chosen.
This all works well.
Each person listed in the table has a unique ID, which also needs to be
read. It appeared a good idea to include this field in the SQL and allocate
the value to another column in the combo box. The ID could then be read
directly as Name.Column(1), where the required surname appeared in
Name.Column(0) (or just Name). Immediately a second column was added,
however, the Unique Value setting failed to filter out duplicate surnames,
presumably for the reason that, with two fields involved, a difference in one
of them is sufficient to render the two records unique. However, name
duplication also occurs when Unique Records is set to Yes, which I find
rather puzzling.
It seems that I will be forced to change all the coding back to the original
version, where the combo box was used to select the name and this was then
used, rather inefficiently, to find the matching ID with a DLookup on the
same table. Apart from that, changing all the code is going to prove a bit
of a nuisance. Is there away of retaining the present arrangement?