Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

list box 2 columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shank - 11 May 2008 09:27 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.