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 
Error Message 3075
John Miller 
       
4 years ago
I have a table that I want to pull a value from. Then table is called abcMonthtbl. Here is the code an error:
   Dim SQL As String

    SQL = "SELECT abcMonthtbl.InvoiceType" & _
          "From abcMonthtbl;"
    
    DoCmd.RunSQL SQL

run-Time error "3075':
Syntax error (missing operator) in query expression
"abcMonthtbl.InvoiceTypeFROM abcMonthtbl'.
Can someone please tell me what I am doing wrong!!!! I thought that the word SELECT was an "operator"?
Thank you In advance
Adam Schwanz  @Reply  
           
4 years ago
If you take out the & _ I think you will see the problem. (missing a space)

SQL = "SELECT abcMonthtbl.InvoiceTypeFrom abcMonthtbl"
Adam Schwanz  @Reply  
           
4 years ago
Add a space either after Type or before From
John Miller OP  @Reply  
       
4 years ago
Tank you Adam I made changes 3 different ways.
1.) SQL = "SELECT abcMonthtbl.InvoiceType FROM abcMonthtbl;"
2.) SQL = "SELECT abcMonthtbl.InvoiceType "& _
               "FROM abcMonthtbl;"
3.) "SELECT abcMonthtbl.InvoiceType "& _
               " FROM abcMonthtbl;"
and each time I get the following error:
Run-Time Error "2342":
"A RunSQL  action requires an argument Consisting of an SQL statement."
Now what is going on?
Adam Schwanz  @Reply  
           
4 years ago
What are you trying to do with that SQL statement? You can only run action queries (append/update/delete) with a statement like that.

Adam Schwanz  @Reply  
           
4 years ago
Sorry, just took the time to really read what you had going on, a SELECT statement there doesn't really make sense. What I think you're looking for is DLookup
John Miller OP  @Reply  
       
4 years ago
OK I now know what you are telling me. Think I understand I will relook at my plan and redo.
Thanks.
Richard Rost  @Reply  
          
4 years ago
Yep. Adam caught it. There's nothing to do if you RunSQL a SELECT statement. That's for action queries. :)

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: 6/17/2026 10:41:26 AM. PLT: 1s