Results 1 to 5 of 5
  1. #1
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296

    How can I check if a combo box value is in the rowsource?

    So I have a combobox that is a list of employee names and I have "limit to list" set to yes but when you enter something that isn't in the list it comes up with an error message that says "The text you entered isn't an item in the list." and I was requested to change that to say something simpler such as "Please select a name from the list".

    I thought this could simply be accomplished by doing something like checking if the combo box value is in the combo box row source (Which is a query) but it turns out that the row source isn't considered an array or collection so I can't cycle through it using a for loop. Is there a better way to check if it is in the row source or not?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you dont have to. If you have LIMIT TO LIST = true, then the box will yell at you if the item is NOT in the list.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    If, it turns out that, you want to easily add a new value, you should watch this youtube video.

  5. #5
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    This is EXACTLY what I was looking for! Thank you Welsh! You're always such a great help!
    I did not realize there was an event for it and I just used it to send a message box with the prompt I wanted and set "Response = 0" so that the default response doesn't pop up.

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

Similar Threads

  1. I am rowsource confused on combo box as a filter
    By Synergy.ron@gmail.com in forum Access
    Replies: 7
    Last Post: 09-20-2021, 04:39 PM
  2. How does one filter the RowSource of a combo box
    By GraeagleBill in forum Programming
    Replies: 12
    Last Post: 01-11-2016, 09:33 PM
  3. Combo box that filters the rowsource
    By billcar2006 in forum Access
    Replies: 3
    Last Post: 02-26-2015, 08:05 PM
  4. Replies: 2
    Last Post: 09-14-2012, 04:40 PM
  5. .RowSource Combo
    By white_flag in forum Access
    Replies: 1
    Last Post: 09-06-2011, 07:59 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