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 / New Users / July 2006

Tip: Looking for answers? Try searching our database.

newbie question: lookup always returns ID, not combo box value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sir Benjamin Nunn - 02 Jul 2006 22:20 GMT
Hi,

I'm not very good with Access (using 2003) and can't get round a particular
problem.

I use the lookup wizard to put a combo box lookup, to allow the text field
in one table to be picked from the list of values in another table.

However, every time I run a query to display values from the table with the
lookup, it returns the idea of the value I've selected, and not the actual
value.

I've simplified the problem below to explain it.

Table 1: ListOfFish

Column 1: ID - Int
Column 2: FishName - Text

1 Cod
2 Trout

Table 2: CaughtFish

Column 1: ID - Int
Column 2: Date - Date
Column 3: Fish - Lookup ListOfFish.FishName

1 01/01/2001 <Cod>
2 02/02/2002 <Cod>
3 03/03/2005 <Trout>

When I run a query to return the 'Fish' for 02/02/2002, I would expect it to
return 'Cod', but instead it returns '1'.

Where am I going wrong?

Any and all help much appreciated, thanks.

BTN
Duane Hookom - 02 Jul 2006 22:41 GMT
Normally you want to store the ID fields while displaying the "name" field
in the combo box. This is done by setting the column widths property.
Setting the property to something like:
Column Widths: 0",1",1.5"
will hide the first column.

Signature

Duane Hookom
MS Access MVP

> Hi,
>
[quoted text clipped - 36 lines]
>
> BTN
Sir Benjamin Nunn - 02 Jul 2006 23:55 GMT
> Normally you want to store the ID fields while displaying the "name" field
> in the combo box. This is done by setting the column widths property.
> Setting the property to something like:
> Column Widths: 0",1",1.5"
> will hide the first column.

Column Widths are aleady similar to that. To clarify, I don't want my
queries to return the ID, I want the names - e.g. the same values I select
in the combo box.

BTN
Duane Hookom - 03 Jul 2006 02:32 GMT
Your query must contain the lookup table if you want to display a field from
the lookup table.

Signature

Duane Hookom
MS Access MVP

>> Normally you want to store the ID fields while displaying the "name"
>> field in the combo box. This is done by setting the column widths
[quoted text clipped - 7 lines]
>
> BTN
Ron2006 - 06 Jul 2006 18:23 GMT
In your query wizard include the lookup table and link the ID of that
table to the field in your main table that the ID number is showing up
in. And then drag and drop or double click the discription/name in the
lookup table so that it is what is on the resultant query.

Ron
 
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.