Thanks John but you didn't catch my drift. I can see that my question needs
fleshing out.
I'm using the form's Filter string, which is created by Access when the
"Filter by Selection" command is used on a control, in VBA code. When the
command is used on combo boxes which have a bound column which is hidden (eg,
an ID field) and display an unbound text field, Access creates a Filter
string based on the text field, eg, "((Lookup_ComboWorkplace.[Workplace
Name]="Microsoft"))". This is clever and works fine on the form, enabling the
user to filter on the displayed text (or even part of it in some
circumstances).
However, what I need for the VBA code is a Filter string based on the ID
field similar to what Access creates if the control is a text box or a list
box, eg, "((qryWorkplace.[WorkplaceID]=51))". I've tried making the bound
column the first column but hidden or the second column and visible - the
only thing that works is making it the first column AND making it visible,
which makes the control very unfriendly to the user.
I'm guessing that the "Lookup_" string is built-in functionality without an
option, so I have one or two workarounds in mind. However, it would be great
if there was a simple property setting, registry setting, or adjustment (eg,
like making the bound column the second column but visible ) that enabled the
alternative behaviour.
Cheers,
Doktore.
Well, the value of the combobox is the value of the bound column.
[quoted text clipped - 12 lines]
use the field and value from the bound column (a long integer ID field) and
NOT the text is the first visible column.