Results 1 to 4 of 4
  1. #1
    Kirtap is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    22

    Combo Boxes - Prevent Error Message when losing focus to user clicking a button

    Hello,



    Let me first describe the situation.

    I have a combo box on a form that the user is limited to the items that populate it. However, I'm having trouble with the message that pops up if they type an item in the textbox portion not in the list and then click off the text box/combobox. There are four buttons on the form, one of them being a submit button in which it is appropriate to show the error message. However, if they click cancel or one of the other buttons and what they typed is like not in the list or half of what they typed, I would like to prevent the message from popping up in such a case. Currently, they can click a button again after the error message to do the necessary action the button calls, but it'd be nice to only have the user click once without that message popup.

    How could I go about this? Is there an event I could catch like the combo box loses focus or if there is a button click I can target and set the textbox to be empty?

    Thankyou in advance.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you explored the "Limit to list" property and the "Not In List" event yet?

  3. #3
    uk123 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    India
    Posts
    10
    Quote Originally Posted by Kirtap View Post
    Hello,

    Let me first describe the situation.

    I have a combo box on a form that the user is limited to the items that populate it. However, I'm having trouble with the message that pops up if they type an item in the textbox portion not in the list and then click off the text box/combobox. There are four buttons on the form, one of them being a submit button in which it is appropriate to show the error message. However, if they click cancel or one of the other buttons and what they typed is like not in the list or half of what they typed, I would like to prevent the message from popping up in such a case. Currently, they can click a button again after the error message to do the necessary action the button calls, but it'd be nice to only have the user click once without that message popup.

    How could I go about this? Is there an event I could catch like the combo box loses focus or if there is a button click I can target and set the textbox to be empty?

    Thankyou in advance.
    See the link for not in the list event http://msdn.microsoft.com/en-us/libr...ffice.12).aspx

  4. #4
    Kirtap is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2013
    Posts
    22
    Hey guys, thanks. Sorry for the late response. Can't believe I totally missed the NotInList event. I can suppress the message from displaying. Now my only problem is that the combobox gains focus after the NotInList event. Is there a way to prevent this so that if Cancel is clicked, the form just closes?

    Thanks.

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

Similar Threads

  1. Combo box error message
    By pbouk in forum Forms
    Replies: 5
    Last Post: 05-08-2013, 07:02 PM
  2. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  3. Replies: 2
    Last Post: 06-26-2012, 10:54 PM
  4. Replies: 3
    Last Post: 07-13-2011, 02:04 PM
  5. Requery without losing focus?
    By Axeia in forum Programming
    Replies: 3
    Last Post: 05-11-2011, 04:53 PM

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