+ Reply to Thread
Results 1 to 10 of 10

Lookup tables in Microsoft access (confusion?)

  1. #1
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Lookup tables in Microsoft access (confusion?)

    I thought I understood lookup tables but it appears that I'm even more confused than ever.
    For example. Please see below for final comments.

    Here is my table. I want to create a lookup combo box in Field2

    table.png


    I use the settings as shown below.

    settings_lookup.png

    But, when I select the combobox values I get the below result. See how the field names appear in the combobox.
    I have selected column 3 (Field 2) to be bound to the combobox in Table1. I have chosen only 1 value to be displayed.
    Why is this happening??? I am clearly misunderstanding lookups!

    I have a similar problem when I select Table/Query as the Row Source Type. If I'm using a whole table as my lookup table and I select the bound column to be 3 and the number of visible columns to be 1 then I should get the result I'm looking for but instead I can only get the ID Field? Again, I have clearly misunderstood lookups!

    result.png

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Lookup tables in Microsoft access (confusion?)

    Row source should be Table / Query and not Field List.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Lookup tables in Microsoft access (confusion?)

    Yes, but that doesn't make any difference. It gets rid of the field lists from the drob down box but insdead I'm stuck with the foreign key in the combobox.

    There's one thing I've done wrong here and that is I've used the same table for the lookup. Let's say there are two different tables.
    Table1 and Table2.

    If I select the third field in Table1 for a lookup using Table2, I select the Row Source Type as 'Table\Query' and the 'Row Source' as Table2 (which has three columns) then I should be able to select the Bound column = 1 and the 'Number of Columns' = 1 to have more names appear for use in the Table 1 drop down box.

    Unfortunately the only way I can do this is to build an SQL statement into the Row Source. Intuitively,,, I shouldn't need to! ???

  4. #4
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Lookup tables in Microsoft access (confusion?)

    I can see that it's not just me struggling with this.

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Lookup tables in Microsoft access (confusion?)

    Just change the column widths to 0 for the Columns you aren't interested in seeing.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Lookup tables in Microsoft access (confusion?)

    You should be doing your lookups in a form and not in tables. Look at this link to understand why.

    http://access.mvps.org/access/lookupfields.htm

    then look at this video on how to set it up in a form.

    http://www.datapigtechnologies.com/f...combobox1.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Lookup tables in Microsoft access (confusion?)

    Quote Originally Posted by alansidman View Post
    You should be doing your lookups in a form and not in tables. Look at this link to understand why.

    http://access.mvps.org/access/lookupfields.htm

    then look at this video on how to set it up in a form.

    http://www.datapigtechnologies.com/f...combobox1.html


    This may be true, but if I can't get the desired result in a table then i'm never going to get it right in a form.

    My knowledge is slowly improving on this, but I'm having trouble getting a particular result.
    If Table1 has an ID column the same as the ID column in Table2, then shouldn't I be able to replace(lookup), say, the Field2 Column, in Table1 with the Field2 values in Table2.

    So in doing this, the Table1 Field2 would be displaying Table2 Field2 values like any lookup.
    Without using the wizard, how do I do that? The ID column should serve as a common value to do the lookup against.

    I realize I would choose the below settings
    Display Control: Combobox
    Row Source Type: Table/Query
    Row Source: This is where I get stuck in achieving the result I want.
    Bound Column: 1
    Column Count: 1





    Table1
    tbl1.png


    Table2
    tbl2.png
    Last edited by danny2000; 03-04-2016 at 07:12 AM.

  8. #8
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Lookup tables in Microsoft access (confusion?)

    I have managed to create a lookup field between these two tables.
    I thought that when I create a lookup field in my Table, that column should display the looked up values? Why would my table not be doing this?

    According to the Access 2002 Bible this is what should happen. (I'm using Access 2010 by the way).

    I should be able to view the table i applied the lookup to in Datasheet View and see the looked up values in their respective column.

    Why is this not happening?

    Here's a screenshot of my lookup properties.

    Even when I change the Bound Column to 2 I can only see the old values. Not the looked up values?
    properties.png
    Last edited by danny2000; 03-04-2016 at 09:25 PM.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Lookup tables in Microsoft access (confusion?)

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).


    crossposted: http://www.accessforums.net/showthread.php?t=58522

  10. #10
    Forum Contributor
    Join Date
    09-23-2007
    Location
    Melbourne, Australia
    Posts
    176

    Re: Lookup tables in Microsoft access (confusion?)

    An thus, still no attempt to help with the issue!
    Last edited by danny2000; 03-05-2016 at 02:44 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 08-12-2015, 05:45 PM
  2. Add Microsoft Access Object Library reference without installed Microsoft Access
    By nichchap in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2014, 08:36 AM
  3. Excel 2010 userform to access and edit the data in MS ACCESS DB tables
    By anand_y59 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 07:46 AM
  4. IF function or LOOKUP confusion?
    By Tea Boy Sid in forum Excel General
    Replies: 6
    Last Post: 11-14-2011, 07:22 PM
  5. lookup/match confusion
    By kryt0n in forum Excel General
    Replies: 2
    Last Post: 10-01-2010, 09:04 AM
  6. Accessing Microsoft Access Tables
    By dok112 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2005, 04:25 PM
  7. Lookup confusion
    By KeenToLearn in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-12-2005, 02:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1