Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
apostrophes in lookup field
Carolyn Jaret 
    
3 years ago
When i use a lookup field in a form to lookup a record that has an apostrophe in it, as in "Homeowner's:, it will show the record in a drop down, but will not pull up the record.  Why is that, and is there a workaround besides not putting apostrophes in records
Scott Axton  @Reply  
        
3 years ago
What event are you running after selecting the record?

Watch the Double Double Quotes video too.  This single quote is a big reason Richard advocates using the "".
Carolyn Jaret OP  @Reply  
    
3 years ago
I want to have the form go to that record.  I have removed all the apostrophes in my records, but that doesn't really make sense that that has to be done.
Kevin Robertson  @Reply  
          
3 years ago
Lookup Fields Evil Access Stuff

How are are you opening the form/going to the record? Macro or VBA?
Screenshots may be helpful?
Kevin Yip  @Reply  
     
3 years ago
Hi Scott, I think she meant combo box on a form.  Hi Carolyn, if it involves string concatenation, you need to double up the quotation marks.  If your combo box selection is used in a form filter in the manner shown below, then the single quote in "Homeowner's" needs to be turned into double single-quotes (''):

     v = Me.MyComboBox
     Me.Filter = "[MyField] = '" & Replace(v, "'", "''") & "'"     ' The Replace() function turns any single quote (') into double single-quote ('')
     Me.FilterOn = True

Richard has video(s) on string concatenation that explain this important topic more fully.  In a nutshell, see my picture below.  Depending on the situation, both single and double quotes may need to be doubled up.
Kevin Yip  @Reply  
     
3 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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: 5/1/2026 9:49:59 PM. PLT: 0s