Results 1 to 4 of 4
  1. #1
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91

    Filtering with combo box on a lookup field


    I've managed to filter my continuous table with one field, so I know the basic method is correct, but this second field I want to filter by insists on including the auto-number PK in the row source of the combo box when I build out its row source query. If I remove the ID from the row source query, the combo box displays a blank list. If I include it, it shows the correct list, but it does not correctly match the value to the field I want to filter by: it returns no results, which to me indicates that it is not trying to match the correct field in the row source query.

    When I look at the result of the row source query without the PK, it does produce the correct list that I want the combo box to display, so I am confused why the combo is not displaying it. Does the PK need to be included? Do I set the bound column to 2 if the PK is 1?

    I hope this makes sense, I can include pictures and code if necessary.

  2. #2
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91
    Solved:
    When creating the combo box with the Access dialogue, it creates a two-column box. Needed to change back to 1 column, and remove the width dimension for the first column as well.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    Generally I always have an ID field and the display field in my combos. Perhaps more than one display field, but ID field is always hidden?

    Also I do not have lookup fields in my tables, EXCEPT for the first DB I created when I did not know any better.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Pawtang's Avatar
    Pawtang is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2021
    Posts
    91
    Quote Originally Posted by Welshgasman View Post
    Generally I always have an ID field and the display field in my combos. Perhaps more than one display field, but ID field is always hidden?

    Also I do not have lookup fields in my tables, EXCEPT for the first DB I created when I did not know any better.

    To clarify: my table does not include lookup fields, I have dedicated lookup tables with a numerical PK and a value field. Then those tables are related on the primary key.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-15-2020, 12:38 PM
  2. Replies: 2
    Last Post: 06-17-2018, 12:07 AM
  3. multiple combo-box based lookup field
    By pmangan in forum Access
    Replies: 4
    Last Post: 12-07-2017, 02:41 PM
  4. Combo Box Lookup field blank.
    By Robert2150 in forum Access
    Replies: 6
    Last Post: 10-02-2015, 11:50 AM
  5. Replies: 4
    Last Post: 07-28-2015, 10:14 AM

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