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 
Insert Query Does Not Insert but No Errors
Richard Stein 
      
11 months ago
I am running an insert statement which stopped running after a few years.  it runs but no error is generated.

I am not running - On Error Resume Next-

I switched to a sql server for the tables and it all ran just fine.  

What is wierd is that the query right above runs and inserts data into a different table.  I copied and ran it in the sql designer and it runs without error and no insert
Richard Stein OP  @Reply  
      
11 months ago

Thomas Gonder  @Reply  
      
11 months ago
Have you considered the things the inhibit messages?
https://599cd.com/blog/display-article.asp?ID=2841
John Davy  @Reply  
         
11 months ago
dim sql as string then set the sql to your string then take a look at what is returned (SQL)  John
Richard Rost  @Reply  
          
11 months ago
Both Thomas and John have some good points. You might want to turn warnings on with the DoCmd.SetWarnings. Also, take John's advice and put that SQL string in a variable first so you can message box it and take a look. Make sure everything looks good. Sometimes, what looks good when you're writing code doesn't look good when it's actually compiled into a string. That'll let you see what's going on.

Also, it shouldn't matter, but sometimes it does. Make sure you have a space after that ) close parenthesis where your field names are right at the end of the first line. Because right now you've got no space between that closed parenthesis and the word VALUES, so you're going to get

...)VALUES

Usually, it doesn't matter, and Access can work with that, but I've seen it cause problems just like not having a space before the word WHERE.
Martin Fairbairn  @Reply  
    
11 months ago
I had a recent experience with exactly the same result trying to insert into a connected mySQL table.  In my case, I discovered the code was perfect.  The problem was the receiving field was NULL and refused to accept the insert.  Now, whenever I create a record with DOUBLE fields, I make sure it makes those fields 0 before update.

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/6/2026 4:34:56 AM. PLT: 0s