Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Search As You Type < Combo Box | Import Access >
Back to Search As You Type    Comments List
Upload Images   Link   Email  
Runtime Error 2185
Daniel Lewis 
   
2 years ago
Hi, this has been very helpful and works a dream until I search for a name that doesn't exist.  for example, I have no customers with the letter 'x' in their name; when I type an 'x' I get a run time error 2185, which highlights my last piece of code.

my code is

Private Sub SearchBox_Change()
    Me.RecordSource = "SELECT * FROM CustomerT " & _
        "WHERE " & _
            "FirstName LIKE ""*" & SearchBox.Text & "*"" OR " & _
            "LastName LIKE ""*" & SearchBox.Text & "*"" OR " & _
            "CustomerCode LIKE ""*" & SearchBox.Text & "*"""
    SearchBox.SetFocus
    SearchBox.SelStart = Len(SearchBox.Text)
End Sub


Any suggestions where I am I going wrong would be a great help.

Thanks
Kevin Robertson 
          
2 years ago
Go to the Form Properties and make sure Allow Additions is set to Yes.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Search As You Type.
 

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/19/2025 5:32:33 AM. PLT: 1s