If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
list box 2 columns
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 |
#2
|
|||
|
|||
list box 2 columns
shank wrote:
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 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. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|