Results 1 to 8 of 8
  1. #1
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14

    want combo box content disappear after selection

    I have a combo box for selecting records - Employee Name.
    The only macro I have is After Update - SearchForRecord where condition ="[Employee Name] = " & "'" & [Screen].[ActiveControl] & "'". The thing is that the content of the comobo box stays there after selection. It is ok when I use the combo box to pick a name because it matches the details below but if I use arrows or add a new record then the name displayed in the combo box if wrong. How to make it disappear after selection?



    I realise these are probably basics...

  2. #2
    RuralGuy's Avatar
    RuralGuy is online now Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    It has to be an unbound cbo for it to work as you have it so just set it to Null after you find the other record.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,446
    Try this:

    In the "On Lost Focus" event for the combo box insert this code

    Code:
    Me.yourcomboboxname.value=""
    me.requery
    Alan

  4. #4
    RuralGuy's Avatar
    RuralGuy is online now Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    Quote Originally Posted by alansidman View Post
    Try this:

    In the "On Lost Focus" event for the combo box insert this code

    Code:
    Me.yourcomboboxname.value=""
    me.requery
    Alan
    Alan,
    I don't think you need the Me.Requery.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  5. #5
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14
    You're a genius Alan Thanks!

  6. #6
    MissVinegar is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jan 2012
    Location
    Belfast
    Posts
    14
    It works without it as well. Thanks Rural Guy.

  7. #7
    sssandhya89 is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2013
    Posts
    15
    Hey Alan,
    I tried this and it doesn't work for me, i want the value in the combo box to disappear after the value is inserted into another table, can you please help me?

  8. #8
    alansidman's Avatar
    alansidman is offline Life @ 7100'
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,446
    What do you mean it doesn't work. Are you putting this code attached to a command button on a form? Give us some more information on what you are specifically doing.

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

Similar Threads

  1. Replies: 8
    Last Post: 06-23-2014, 12:19 PM
  2. Replies: 33
    Last Post: 01-13-2012, 07:44 AM
  3. Reports list disappear in combo box.
    By cap.zadi in forum Forms
    Replies: 4
    Last Post: 01-04-2012, 09:26 AM
  4. Replies: 1
    Last Post: 02-16-2011, 11:40 AM
  5. Replies: 1
    Last Post: 08-26-2009, 10:45 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
  •  
Tech Forums: Microsoft Office Forums