Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Genealogy Form - Personf - How to Empty Search Box
Tom Juric 
       
48 minutes ago
I created a search combobox on the PersonF form. It works fine except for one small but irritating issue: AFTER I select a name, the list in the combobox remains. The main for displays the selected record but I cannot get the box to display empty.  Attached is a photo after I selected "Thomas Juric". I am posting the code in the two events being used:

DetailsPrivate Sub cboMemberSearch_AfterUpdate()
On Error GoTo cboMemberSearch_AfterUpdate_Err

    DoCmd.SearchForRecord , "", acFirst, "[PersonID] = " & Str(Nz(Screen.ActiveControl, 0))
    'Me.cboMemberSearch.Text = ""

    cboMemberSearch = Null
cboMemberSearch_AfterUpdate_Exit:
    Exit Sub

cboMemberSearch_AfterUpdate_Err:
    MsgBox Error$
    Resume cboMemberSearch_AfterUpdate_Exit

End Sub


DetailsPrivate Sub cboMemberSearch_Change()
    'Search as you type for Member
    
    cboMemberSearch.RowSource = "SELECT PersonID, LF " & _
    "FROM qryPerson " & _
    "WHERE LF Like ""*" & cboMemberSearch.Text & "*"" " & _
    "ORDER BY LF;"
    
    cboMemberSearch.Dropdown

End Sub
Tom Juric OP  @Reply  
       
48 minutes ago

Kevin Robertson  @Reply  
           
40 minutes ago
To empty the Combo Box you need to set the Row Source to an empty string.

cboMemberSearch.RowSource = ""
Tom Juric OP  @Reply  
       
14 minutes ago
I have been unable to determine where that code would go. Placing it in AfterUpdate and OnChange  will make it go away but when code has completed running the list shows back up.
Kevin Robertson  @Reply  
           
9 minutes ago
After this line in After Update.

cboMemberSearch = Null
Tom Juric OP  @Reply  
       
4 minutes ago
Kevin, After WHAT line?
Kevin Robertson  @Reply  
           
3 minutes ago
Your Change event is putting the Row Source back in.
Is there a particular reason why you need to clear it?
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 12/2/2026 4:22:03 PM. PLT: 1s