Results 1 to 4 of 4
  1. #1
    tanyalee123 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    51

    Question Clearing Contents of a Dropdown

    Good afternoon!

    I have a form, and at the top I added 2 dropdown fields to assist the user in searching. One to search by SSN and one to search by last name. Because these work independently of one another (i.e. when the SSN dropdown is used, it doesn't effect or change the search by last name drop down; it's just 2 options for her to search), I don't want it to look confusing for the user if she uses the boxes for 2 different searches.



    Therefore, I'd like the contents of the search to empty once she clicks elsewhere (loses focus), and that way if her eyes move up to those 2 search boxes after the record has been found, they will be empty. I'm assuming I need to use VBA to do this...anyone know how? Thank you!!
    Tanya

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Those two comboboxes are UNBOUND?

    Are you using a dynamic parameterized query as the form RecordSource?

    Do you have a procedure that requeries the form? Include code in that procedure to empty the comboboxes.

    Me.comboboxname = Null
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    tanyalee123 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2013
    Posts
    51
    Thank you for responding.

    Yes they are unbound combo boxes (they were creating just by using the combo box wizard in which you indicate you want the combo box to find a record based on your choice). Sorry, I don't know what your second question means, but the wizard creates a query as the row sourse, yes.

    Where would I put that procedure? In the properties under the "After Update" event, there is a macro..the Action is "SearchForRecord" and the arguments are - , , First, ="[UniqueID] = " & Str(Nz(Screen.ActiveControl,0)). This is all created by the wizard.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    My second question was regarding the form RecordSource, not the combobox RowSource. However, disregard it.

    The code I show is VBA example. I think doing the equivalent in macro requires SetValue method. I never use macros.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. cbo not clearing
    By buckwheat in forum Access
    Replies: 1
    Last Post: 06-26-2013, 03:51 PM
  2. Replies: 5
    Last Post: 04-18-2012, 12:04 PM
  3. Replies: 9
    Last Post: 05-23-2011, 06:12 PM
  4. Replies: 0
    Last Post: 03-29-2011, 04:11 PM
  5. Clearing the clipboard with VBA?
    By Simon Sweet in forum Programming
    Replies: 1
    Last Post: 04-17-2008, 03:16 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