I have a form with a list box which gets its values from a lookup table.
Upon submit, the form provides input to an append query.
Column1 is bound and works fine.
However, I also need Column2 in the query. How do I reference Column2 in the
query?
[Forms]![frmNewPO]![frmBoxFactory] is the control reference and that gives
me Column1 as expected.
The column I need from the lookup table is [Prefix]
I'm trying [Forms]![frmNewPO]![frmBoxFactory].[Prefix] and it's not working.
So, maybe the question is "How do I bind 2 columns in the list box?"
thanks
Rick Brandt - 11 May 2008 12:14 GMT
> I have a form with a list box which gets its values from a lookup
> table.
[quoted text clipped - 15 lines]
>
> thanks
The syntax for referring to a non-bound column is...
[Forms]![frmNewPO]![frmBoxFactory].Column(1)
The left-most column is Column(0) so Column(1) is actually the second one.
Unfortunately that does not work in a query. You might find that wrapping
the reference in the EVal() function works...
=EVal([Forms]![frmNewPO]![frmBoxFactory].Column(1))
...or you can add a hidden TextBox to your form with a ControlSource of...
[Forms]![frmNewPO]![frmBoxFactory].Column(1)
...and point your query at that control instead.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com