Results 1 to 7 of 7
  1. #1
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    116

    Data Validation for Combo Box Based on Query

    I'm not sure if this is more of a form question than a query question.

    I have a listbox on a form that allows the user to select one of several options from a query. But I want to make sure that the user only selects one of the options from the query results. I understand that the beforeupdate property can do this. But I'm not sure how to go about doing that.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    From the sound of it, just make sure the multiselect property of the listbox is None.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    116
    I guess I could have tried that but I just made a "before update" if statement and that did the trick. Thanks though.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Less intuitive to me, but whatever works for you. As a user I might be annoyed if I was able to select more than one and then later got told I couldn't. That forces me to go back and unselect items to get back to one.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    116
    Quote Originally Posted by pbaldy View Post
    Less intuitive to me, but whatever works for you. As a user I might be annoyed if I was able to select more than one and then later got told I couldn't. That forces me to go back and unselect items to get back to one.
    Where is the multiselect property? I've been looking all over for it

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    On the Other tab of the listbox properties.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Ganymede is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    116
    Quote Originally Posted by pbaldy View Post
    On the Other tab of the listbox properties.
    Odd. It's not appearing in the 2013 version.

    Oh. I know what I did. I called it a listbox instead of a combobox. Sorry. It's a combobox. Doh!

    Thank you though.

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

Similar Threads

  1. Replies: 24
    Last Post: 02-11-2014, 06:41 AM
  2. Replies: 6
    Last Post: 05-16-2013, 07:44 PM
  3. Validation of one field based on another
    By AussieGal in forum Access
    Replies: 10
    Last Post: 07-12-2012, 11:07 AM
  4. Query based on combo box
    By hawkins in forum Queries
    Replies: 10
    Last Post: 08-19-2011, 05:27 PM
  5. Replies: 1
    Last Post: 11-19-2010, 09:08 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