Results 1 to 3 of 3
  1. #1
    RedGoneWILD is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    105

    combo box question

    How do you prevent a combobox from being entered? For instance, I have a combobox that contains two values; a "1" & "2". Additions are turned off, so if I were to enter a "3", it tells me that's not possible. But I don't even want the user to be able to enter the combobox. I just want them to be able to select the down arrow to pick either "1" or "2". Sorry if this is a stupid question.



    Additionally, I have an after update event for the combobox. Depending on if a "1" or "2" is selected, a different message box pops up. However, If the value is already "1" and the user selects the combobox and accidentally selects "1", I don't want anything to pop up since nothing has changed. Only when the value is changed from "1" to "2" or from "2" to "1" do I want the message box to show. I tried setting a variable to the value before the change happens, but that didn't do anything, or at least I did it wrong. Thanks in advance for any help.

    PS: Generally the functionality works exactly as I want already, these are both very minor issues that I have.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Depending on if a "1" or "2" is selected, a different message box pops up. However, If the value is already "1" and the user selects the combobox and accidentally selects "1", I don't want anything to pop up since nothing has changed. Only when the value is changed from "1" to "2" or from "2" to "1" do I want the message box to show
    I assume you are using a If/Then. Test for ActiveControl.Value <> ActiveControl.OldValue
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    RedGoneWILD is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    105
    thank you very much, will try that shortly.

    Any suggestion on preventing the user from entering a different value, even if it's disallowed? I would essentially like the value part of the combobox to be locked and disabled like a textbox so an edit isn't even attempted.

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

Similar Threads

  1. Combo Box question!!
    By johnjohnson in forum Forms
    Replies: 2
    Last Post: 12-10-2011, 02:41 PM
  2. Combo Box Question
    By hawkins in forum Forms
    Replies: 1
    Last Post: 06-27-2011, 01:32 AM
  3. Question-Combo-Box
    By rockrider in forum Forms
    Replies: 1
    Last Post: 02-16-2011, 06:24 PM
  4. Combo box question
    By nkenney in forum Forms
    Replies: 1
    Last Post: 07-09-2009, 08:08 PM
  5. A combo box question
    By GeorgeD in forum Forms
    Replies: 3
    Last Post: 05-05-2008, 10:53 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