Results 1 to 9 of 9
  1. #1
    MCCDOM is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Posts
    28

    Displaying only unique values

    Hi all,



    I am trying to create a combobox that acts as an auto-complete box to speed up the form filling in process. The combobox is getting the results from a column in a table but is showing everything including the duplicates when I only want to view a list of individual names. I've done some research and have come accross SELECT DISTINCTROW but am unsure on how to implement this for a combobox or if this is the best method for going about this.
    Would really appreciate some help.

    Thanks

    Dom

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    In the query of the combo box, open the properties, set UNIQUE VALUES = YES.

  3. #3
    MCCDOM is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Posts
    28
    Thanks for your reply. You must excuse my basic knowledge of Access but where can I find this? The combobox is in a form and is setup after using the wizard to retrieve data from the specified column in a table.

  4. #4
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Select the combobox control, go to it's Property Sheet, then go to RowSource (in the Data tab). Click the "..." button to open the query builder. In the query builder, open the property sheet (if not already) then you will see a property called "Unique Values". Set property to Yes.

  5. #5
    MCCDOM is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Posts
    28
    Thanks, I have done this but the combobox only shows three blank rows.

  6. #6
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Go back to the query builder of the Row Source, and view the query as a Datasheet and see if you are seeing what you expect.

    If so, make sure your combobox's properties for ColumnCount and ColumnWidths (under Format) match the query.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Instead of DISTINCTROW, try just DISTINCT.
    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.

  8. #8
    MCCDOM is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Posts
    28
    I changed the column width and they are now being displayed. Thanks a lot everyone for your help.

  9. #9
    thebigthing313 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    119
    Good luck with the rest of your project.

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

Similar Threads

  1. Using Criteria to Count Unique Values
    By bryan0 in forum Queries
    Replies: 1
    Last Post: 07-21-2014, 12:43 PM
  2. Sum of double values with unique ID
    By javeko in forum Access
    Replies: 1
    Last Post: 03-06-2014, 03:01 AM
  3. Unique values
    By helpaccess in forum Queries
    Replies: 3
    Last Post: 09-19-2011, 03:46 PM
  4. Creating a unique ID for a new set of values
    By slaterino in forum Programming
    Replies: 1
    Last Post: 08-24-2010, 09:35 AM
  5. Count of Unique Values
    By vsmk in forum Queries
    Replies: 2
    Last Post: 03-14-2010, 12:07 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