news:mJ_ir.9816$YM2....@newsfe05.iad...
> "Neil" wrote in message news:jmh2sq$bm8$1...@dont-email.me...
>
>>>
>>> No, that wouldn't work. What we're discussing here is using a combo box
>>> column in the criteria row of a query. So what you propose wouldn't
>>> apply there. The only way would be to use a function.
>
>>Correction - it's a list box (as stated in the original post), not a combo
> box.
>
> Actually, my suggestion will still work. What I am suggestion here is to
> base the main form on a query (base form table), and then left join in the
> additional columns you need from the table that drives the combo box. At
> that point, when you selected a value in the combo box, the several other
> columns you included from that table will now display (with out code) I
> those additional text boxes that are bound to that combo box table.
Yes, I understand that. But this is an unbound listbox (sorry I said combo
box in my last message; I corrected that in a follow up). I thought it was
clear, since it was a list box, that it was unbound (at least for me, I
can't remember ever using a bound list box; list boxes are always used by me
just to make a selection). So I thought it was clear that we were dealing
with an unbound control that was used just for selection.
So, yes, I understand about using lookup tables in the main form query and
getting those values. I do that all the time. But this is an unbound list
box, so that wouldn't apply. Sorry if that wasn't clear.
> So my suggestion works for both combo box, listbox and in fact if you just
> placed a bond text box and typed in the id value into this bound FK text
> box, then all of the several other text boxes on the form will auto update
> and display the information from those additional columns from the joined
> in table.
Yes, it would work the same for a list box as for a combo box; they're both
the same, essentially. The point I made above, though, is that I've never
used a bound list box. Maybe that's just me. I just find that combo box
works much better with a bound field, and list box works well as an unbound
control for making a selection.
Anyway, regardless of whether or not people use bound list boxes, in this
case, anyway, it's unbound.
> In fact, I wondering if placing a text box on the form with the expression
> =(cboBox.column(2)) would allow that text box to be used in the query
> expression - if this works (not tested), then my suggestion to add the
> additional columns by use of a left join query (and base the form on that
> query) would not even be required.
Actually, that does work. So, thanks for the workaround. :-)
Neil