Results 1 to 4 of 4
  1. #1
    Purdue_Engineer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    9

    Clearing Combo Box when adding a new record

    Does anyone know how to clear a combo box when adding a new record?

    I have a combo box which searches for a customer by name, and then populates a form based on the name chosen.

    The problem I have is when I go to add a new record to the form, the same name in the combo box remains from previously choosing it.

    For example, if I choose Bill Jones to lookup and/or edit his information, and then want to save that and create a new record, "Bill Jones" remains in the combo search box. All of the other areas of the form become blank ready for a new entry except for the combo search box.

    I have looked around the web for code and have used AfterUpdate code on the combo box to no avail.

    Any help would be greatly appreciated!

    Thanks

  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,521
    You should be able to set the combo to Null or "".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Purdue_Engineer is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2012
    Posts
    9
    Quote Originally Posted by pbaldy View Post
    You should be able to set the combo to Null or "".
    Where/how should I code that?

    Thanks for the response.

  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,521
    With the search code. This type of thing:

    Code:
      Dim rs As Object
    
      Set rs = Me.Recordset.Clone
      rs.FindFirst "[Acc_ID] = '" & Me![cmbFindDriver] & "'"
      Me.Bookmark = rs.Bookmark
      Me.cmbFindDriver = ""
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 08-14-2012, 07:14 AM
  2. Replies: 14
    Last Post: 05-25-2012, 02:40 AM
  3. Clearing Checkbox on New Record
    By rossi45 in forum Programming
    Replies: 5
    Last Post: 04-16-2012, 05:30 PM
  4. Clearing certain boxes on form for next record using VB
    By justinwright in forum Programming
    Replies: 3
    Last Post: 07-21-2010, 12:16 PM
  5. Adding a record based on combo
    By cjamps in forum Forms
    Replies: 1
    Last Post: 02-24-2009, 12:01 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