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 
Missing Operator in Query
Steven Dull 
    
5 years ago
I wrote the code from access developer 24 Copy Proper where the existing record from a form and the subform would be copied and pasted into a new record.  The code runs until arrives at Set rsOld = CurrentDb.OpenRecordset("SELECT * FROM OrderT WHERE OrderID=" & orderid) that's when I received the message "missing operator in query expression"  Everything appears to be correct, I even followed trouble shooter through and including reboot computerAny Clues?
Richard Rost  @Reply  
          
5 years ago
First thing, check your OrderID to make sure it has a value. Before that line do:

MsgBox OrderID

And make sure it's got a valid value in it. Then make sure there actually are records in the tables (both of them) that have that OrderID.
Steven Dull OP  @Reply  
    
5 years ago
interesting, It doesn't have and "orderid" number spite the fact I can see it on my form
Richard Rost  @Reply  
          
5 years ago
Gotta have it. Check the NAME of the OrderID text box. If it's something like Text13 then change it to OrderID. A screen shot would help (Upload Images at the top of the thread).
Steven Dull OP  @Reply  
    
5 years ago
The Interesting part is it got past the isnull statement. Could it possibly be my version of access, I use 365 and it says I'm using version 2018.  This database possibly was created by a different version of access, Could that make a difference?
Richard Rost  @Reply  
          
5 years ago
There is no Access 2018. There is 2016, 2019, and 365. You're probably looking at the build number which is 2108.

Let me see a screen shot of your code and your form.
Steven Dull OP  @Reply  
    
5 years ago

Richard Rost  @Reply  
          
5 years ago
There's your problem. The NAME of the control is ordertid. See the T in there? That's why capitalization helps.
Steven Dull OP  @Reply  
    
5 years ago
I just saw a miss spelled word in the name of ORDERID...Dang it
Richard Rost  @Reply  
          
5 years ago
Missing operator in query expression almost always means that Access can't find the field you specified, which is 99% of the time because it's spelled wrong. Common mistake. I do it myself all the time.
Steven Dull OP  @Reply  
    
5 years ago
I cant believe something that small held this all up, Thanks Captain Richard...It's working great
Richard Rost  @Reply  
          
5 years ago
You're very welcome... and it's Fleet Admiral Richard, thank you! Check the pips, son! LOL

Live long, and prosper.
Steven Dull OP  @Reply  
    
5 years ago
LOL, 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/2/2026 10:07:17 AM. PLT: 0s