Results 1 to 8 of 8
  1. #1
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63

    Alternative to Lookup fields

    Some developers don't like to use Lookup fields, Why? And if they are right, then what is the alternative (that work like a Lookup field)

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Lookup fields are wonderful, a godsend.
    Why haters gotta hate?

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Lookup fields are a real PITA to deal with, always messing up my queries and forms! They cause issues which are hard to track down. I much rather have things under MY control so that I know when they are broken and how to fix them. I make my own lookups using queries.

  4. #4
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    I always read to avoid the lookup field type in regard to lists with basically a hidden lookup table, per aytee and Allen brown etc, so I don't use them. That said I just noticed today that on a table you can make a number type field for example (fk), go to the lookup tab in the table field editor, select display combobox, and use sql as a row source to lookup another table??? Do it once here so I don't have to do it on every form the field shows up. Is there anything wrong with utilizing this feature?

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

  5. #5
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by kd2017 View Post
    <snip>
    That said I just noticed today that on a table you can make a number type field for example (fk), go to the lookup tab in the table field editor, select display combobox, and use sql as a row source to lookup another table??? Do it once here so I don't have to do it on every form the field shows up. Is there anything wrong with utilizing this feature?
    Uhhhh...... this is known as a "Look up FIELD"!!

    Which you referenced here:
    The Evils of Lookup Fields in Tables

  6. #6
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Oh.... Okay clearly I haven't paid much attention to them and misunderstood what a lookup "field" was. I thought it was a field with just a list of items... simply a 'value list' not associated with a user defined table. My bad

  7. #7
    Athar Khan is offline Advanced Beginner
    Windows 7 32bit Access 2013 32bit
    Join Date
    Mar 2017
    Posts
    63
    When used in queries, I think a Lookup field is only confusing when we refer to an ID Field in our query, which is always numeric, but we expect a string value in the query results.
    For example if I want to list customer names in a combo box on a form, I use Lookup field. As a result, I see customer names in "CustomerID" field but when I want to use the value (of a column) of that combo box somewhere else, I expect the same customer name which is being displayed in "CustomerID" combo box field, but in fact, I don't have customer name saved in "CustomerID" field.
    The mistake or confusion here is that I did not include the CustomerName field in my new query because I always see the customer name in "CustomerID" field on the form, which is actually a key column, but it displays the CustomerName which was requested by Lookup field query.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Lookups with alias display set in table are fine if you know what is really happening. As you noted, the text alias would display, not the actual saved ID. This can be quite confusing to novices. Innumerable threads are posted by novices with this topic - 'Why can't I filter when I enter name?'. Then there's "Why does my crosstab show ID and not the text as column headers?"

    When I view tables I want to see the actual stored value, not the alias. I build comboboxes on form.

    Build queries that join tables to retrieve related descriptive text.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-02-2017, 03:49 PM
  2. Replies: 4
    Last Post: 03-17-2016, 07:16 AM
  3. Replies: 30
    Last Post: 09-23-2015, 07:24 AM
  4. Lookup Field Alternative
    By bbrazeau in forum Access
    Replies: 5
    Last Post: 09-24-2013, 01:40 PM
  5. Lookup Fields
    By ericjsr in forum Programming
    Replies: 2
    Last Post: 07-16-2012, 09:15 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums