Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2010
    Posts
    18

    Unanswered: Adding a lookup to a column

    While looking at the record itself I tried to add a lookup to an existing column - couldn't find a way to do it. Access wants to Insert a new lookup column.

    Ok, I'll go with that and then rename it. I made my lookup and whoa! great joy, it shows me what I want. Then I found I was unable to rename it from 'Field1.'

    I Saved, reopened and bingo, the column 'Field1' is still there but the little drop-down for the lookup has gone.

    What am I doing wrong?

    Thanks - rev

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by revnice View Post
    What am I doing wrong?
    Trying to create a lookup column in the first place:
    The Access Web - The Ten Commandments of Access
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Gee thanks

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    If your reply is sarcastic (as it seems - I might be wrong, it is hard to tell on forums) then I would recommend you read the article again.

    It might not be what you want to hear, but it is the reality. Lookup columns are a half-assed proprietary Access sack of cack that should be avoided at all costs. Google Dev Ashish (the author of that article) if you doubt his credentials.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Aug 2010
    Posts
    18
    Apologies, I didn't notice the link, only your comment.

    I'm a novice, I understand relational databases but I'm stymied by the simplest functionality in Access.

    The smallest thing can hang me up for hours so I really look forward to responses from here.

    Will read your link.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Cool - make sure you read the link within that link too (it expands on the evils on lookup columns).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I have heard all of the evils of using Lookup columns but I continue to use them anyway. I find them to be very helpful/useful. However, I am my own user. The programs that I write are the programs that I use. So with that said, if you still want to know how to do it then here it is:

    Design your table, choose the column you want, click on the Lookup Tab at the bottom of the design screen. Then switch the Display Control to Combo Box. Then a Row Source property will be visible. Click on the ... to go the query designer. Add the table that you want and the fields you want. In most cases you will add the table's Primary key along with a description field. Then close you query and save the changes. Access will put the SQL in the Row Source property.

    If you have used two fields (Primary Key field and a description) then Bound Column should be 1 (Access will store the Primary Key but display the Description). Then in the Column Count field put 2 and finally in the Column Widths field oput 0;2 for 0 inches for the first field (effectively making it invisible to the user) and 2 inches for the Description field.

    Save and open your table. Then the user can select the description instead of trying to remember that 1 = Fax and 2 = Phone etc.

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by DCKunkle View Post
    Save and open your table. Then the user can select the description instead of trying to remember that 1 = Fax and 2 = Phone etc.
    Obviously you don't ever want your users having to remember surrogate keys, however you don't need a lookup for that, merely a combo box.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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