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 
Compare String not working
Kim Wong 
     
2 years ago
I have the following code.  It works until I insert the condition for Entity. Entity is a short text field in my table. When I change the Entity field to a numeric field it works.  So it looks like i am not coding it properly to check for text field?  Its giving me the error: The Object doesn't contain the Automation object...

DMax("[ContractT.ContractID]","ContractT","[ContractT.EmpID]=" & [Forms]![MaintainContractF]![EmpID] & " AND [ContractT.Entity] = " & [Forms]![MaintainContractF]![Entity] & " AND [ContractID] < " & [ContractID])
Kim Wong OP  @Reply  
     
2 years ago

Sami Shamma  @Reply  
             
2 years ago
Can the [Entity] be Null?
See:
Null Math and Null
Alex Hedley  @Reply  
           
2 years ago
Kevin Yip  @Reply  
     
2 years ago
Hi Kim, what is the complete error message?  There should be something at the end: "The Object doesn't contain the Automation object ______"
Kim Wong OP  @Reply  
     
2 years ago
Beautiful...double double Quotes worked!!!  I knew it was  the string match that was not working.  I was looking high and low for what was  wrong. For a common operation, I couldn't find anything when i googled 'string not matching, etc'... not knowing about double double quotes, that was not my search criteria.  

Thanks very much Alex; I was literally spending hours trying to solve it.

This is an awesome forum..thanks everyone!!
Alex Hedley  @Reply  
           
2 years ago
Happy to help.

You can do it with single quotes like ". . . Field='" & [Control] & "'" but then if you have an apostrophe in a word it'll not work so getting into the habit of DDQ is probably a good idea.
I always try hardcoding it first then replacing it one at a time to make sure I haven't missed any quotes, it can get you!
Kim Wong OP  @Reply  
     
2 years ago
DDQ certainly a good practice.  The quotes certainly got me -that's a good way of working it.  Thanks again!

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/8/2026 9:32:30 PM. PLT: 0s