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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
What Do All The Quotes Mean?
Mark Fannin 
      
2 years ago
I finally got the command button to work by using a macro and then a writing VBA statement.  Why are there so many quotes in the customerNum part of the clause?  More importantly is there a resource (book, website, etc.) where I can learn to dissect statements and their clauses piece by piece?  
Thanks in advance.

Private Sub OpenCustomer_Click()
    DoCmd.OpenForm "UpdateCustomerF", , , "customerID=" & "'" & customerNum & "'"
End Sub
Sami Shamma  @Reply  
             
2 years ago
Kevin Robertson  @Reply  
          
2 years ago
You don't need the first ampersand. Your single quote doesn't need to be in a string on its own

   DoCmd.OpenForm "UpdateCustomerF", , , "customerID='" & customerNum & "'"

I prefer using Double Double Quotes as detailed in the video Sami linked you to.

Out of curiosity:
   What Data Type is CustomerID?
   Why have you named the fields you are comparing differently?

Quick note:
   I like to prefix all my Buttons with btn so I know at a glance I am working with a Button.
   Also:
      cbo: Combo Box
      lst: List Box
      lbl: Label (is referred to in code)
Mark Fannin OP  @Reply  
      
2 years ago
Hi Kevin.  customerID is short text because a customerID has alpha and numbers.  
I named the fields differently because I didn't know any better.  Now I am quickly learning :)
I like your naming convention, and I see its advantages.  
But where did you learn all the ins-and-outs of the quote dilemma?  There's gotta be a better way than trial and error?  There has to be a published protocol, right?
Many thanks for your help.  All the best to you.
Jeffrey Kraft  @Reply  
      
2 years ago
I prefer Double Doubt Quotes except in my case in can be closer to Double GetinTroubleWiththeDouble Quote.  I will get it eventually but still.
Mark Fannin OP  @Reply  
      
2 years ago
Is there a free reference (online or pdf) that explains all the VBA commands and all the options that go with them?  There are so many commands, clauses, filters, options, that there has to be a reference somewhere.  Thanks for all the help.
Alex Hedley  @Reply  
           
2 years ago
Mark Fannin OP  @Reply  
      
2 years ago
Thanks for the reference Alex.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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/7/2026 12:56:59 PM. PLT: 2s