Results 1 to 3 of 3
  1. #1
    ABB125 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2018
    Posts
    5

    How to create a lookup field which accepts entries from both fields in the linked table

    Good morning,

    Apologies if the title is a bit vague.

    I have a table with two fields - one for the name of each record, and one for its 3-letter code, eg: Raspberry Jam = RBJ.
    I am trying to create a lookup field in another table where I can enter either the 3-letter code if I know it, or the item name if I don't. Whichever I do, I am hoping that I can store the 3-letter code value in the cell.


    However, I can't make it work. Can anyone help?

    Here is an example:

    Someone has purchased a product off me, 50mm thick insulation board. I don't know the 3-letter code for this, so I begin typing "50mm insulation board" into the lookup field. As I type each character, the lookup field automatically updates the drop-down list with possible fields; when the one I am looking for appears, I select it, and the 3-letter code, let's say INB, is stored as the cell value.
    Conversely, if I know that 50mm insulation board is INB, I can type "INB" into the lookup field, and the drop-down list will show what INB is, to confirm that it is the correct 3-letter code.

    Many thanks for your help.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    lookup fields in tables is a bad idea - use a form

    with regards your combo, suggest use a union query as a rowsource - something like

    SELECT ProdID, ProdDesc FROM tblProducts
    UNION SELECT ProdID, ProdID FROM tblProducts

    however typing in 'INB' will show any products that begin with INB as well - Access won't know which field you want to look at

    Alternative is to have two combos, both bound to ProdID one based on ProdDesc and the other of ProdID and let the user choose

  3. #3
    ABB125 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2018
    Posts
    5
    Quote Originally Posted by Ajax View Post
    lookup fields in tables is a bad idea - use a form

    with regards your combo, suggest use a union query as a rowsource - something like

    SELECT ProdID, ProdDesc FROM tblProducts
    UNION SELECT ProdID, ProdID FROM tblProducts

    however typing in 'INB' will show any products that begin with INB as well - Access won't know which field you want to look at

    Alternative is to have two combos, both bound to ProdID one based on ProdDesc and the other of ProdID and let the user choose
    Thanks very much.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-17-2016, 07:16 AM
  2. Replies: 4
    Last Post: 03-01-2016, 09:39 AM
  3. Replies: 30
    Last Post: 09-23-2015, 07:24 AM
  4. Replies: 1
    Last Post: 05-20-2013, 01:45 PM
  5. Replies: 1
    Last Post: 09-11-2012, 10:31 PM

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