Results 1 to 4 of 4
  1. #1
    BudMan is offline Novice
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Location
    Stem, NC USA
    Posts
    20

    Question "lookup" list in a query

    I created a table with a “lookup” field that gets its value from another table. That works fine.

    Now, when I create a query on that field, I need to enter the data into the query directly. The problem is that I do not always remember the exact spelling or name I am looking for. I would like to have a pop-up list appears that I could use to pick the data from. I know I can use something like [enter name] in the query box, but that is not what I want. I want a pop-up list like the one that appears when I manually add data to the field.

    First, I hope I explained this correctly, and two, is it possible?

    Thanks!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,535
    I would advise against using lookups in tables. Use lookups in forms.
    I would advise against using queries to manually enter data. Use forms for data entry.

    EDIT:
    Perhaps you should have a form bound to the data in table1.
    Have on that form a combo box bound to the field in table1 that you currently have a lookup.
    The combo box would use the lookup table for you to select from.

    See: http://access.mvps.org/access/lookupfields.htm
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    If you have a combo box, bound to a datalist as source data to pick,
    then start typing in the box, the selection should jump to the value as you type.

    If you want a textbox to filter a 'fuzzy list' use this code:

    the combo box cboRoomSize
    has a list of all room sizes to pick from via qry: qsRoomSizes1Type

    use the textbox to narrow down the combo box...
    here the fuzzy search text box to enter is: txtSizeFind
    enter 43
    this will then filter the combo box with only sizes that have 43 in the value:

    Code:
    sub txtSizeFind_Afterupdate()
    If IsNull2(txtSizeFind) Then
       cboRoomSize.RowSource = "qsRoomSizes1Type"
    Else
       sSql = "select * from qsRoomSizes1Type where [size] like '" & txtSizeFind & "*'"
       cboRoomSize.RowSource = sSql
       cboRoomSize.Requery
        
          On Error Resume Next
        cboRoomSize.SetFocus
        Me.cboRoomSize.Dropdown  'show user the choices
    End If

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

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

Similar Threads

  1. Replies: 4
    Last Post: 04-12-2019, 09:47 AM
  2. Replies: 2
    Last Post: 04-12-2016, 12:58 PM
  3. Replies: 3
    Last Post: 12-06-2014, 03:59 AM
  4. Replies: 1
    Last Post: 12-28-2012, 02:54 PM
  5. Replies: 11
    Last Post: 03-29-2012, 02:32 PM

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