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 
Datatype mismatch
Marina Morgan 
       
3 years ago
Hi,
how comes that I get a datatype mismatch error in a report when all underlying subreports and queries are running just fine. I just can't make out the error.
Any ideas how to hunt down the error?
Thanks in advance
Marina
Scott Axton  @Reply  
        
3 years ago

This is a pretty broad question.  I would start out with the report that you are trying to generate.  
What tables does the report use?  What are you trying to do?

The most common problem I see is that I have used Short Text in an ID field that links to an Auto Number field in another table.

Second, if you are doing math on a field, check that those fields are the same data type.

If this doesn't help you get started we may need more details, including screen shots of where this is happening.  What is the exact message and when does it occur?
Scott Axton  @Reply  
        
3 years ago
Go watch the Type Mismatch FastTip video. That may help explain the error better than I just did.
Marina Morgan OP  @Reply  
       
3 years ago
Hi Scott, thanks for the tip and the quick response. The strange thing is though that the report was working fine until last week and I have not changed anything in the database. I assume that some data in the linked tables could be wrong since many different people work with these. But then again why do all the queries and subreports work?
I will watch the video and hopefully find a solution to this problem there.
Scott Axton  @Reply  
        
3 years ago
Marina if it was working before and just suddenly quit I would suspect the case that Richard points out in the video above where a user put in an invalid response like "N/A".

Are you getting any other detail other than a mismatched date message box?  Does it take you to the code and highlight in yellow where the error is?

Once we figure out where the error is we can figure out how to fix it and also how to prevent it in the future.
Marina Morgan OP  @Reply  
       
3 years ago
I also suspect that someone put an invalid value in one of the linked tables. But why are the queries and everything else work fine and just in the report it gives an error message?

No, it does not take me to the code, just the Message Box Data type mismatch in criteria expression.

I guess I have to check all the approx. 50000 record sets 😒

Thanks for your support.
Marina Morgan OP  @Reply  
       
3 years ago
Hooray, I found the mistake. Someone in fact put two quantities in one field. I found out by just deleting one field of the report after the other and running the report and if the error still appeared I put the field back in and tried the next one. This way I found that it had to be the quantity field, that causes the error.

Now I only have to find out how to prevent people to put more than one quantity in that field. And why the query still runs fine and gives no error message....
Scott Axton  @Reply  
        
3 years ago
That is fantastic news.  Glad that you found it pretty easily.
Here is one thing to check.  On the form where you enter the quantity, make sure the Enter Key behavior is set to Default.
Not New Line in Field.  That could be one place where an error could occur.

See below:

Marina Morgan OP  @Reply  
       
3 years ago
Hi, thanks so much, that is exactly what I was looking for to prevent the error. I have already implemented it and tested it and it works!!
Scott Axton  @Reply  
        
3 years ago
Wonderful!! Don't you love it when the fix is easy?  Glad that helped you out.
Marina Morgan OP  @Reply  
       
3 years ago
Yessss, I love it. I wish it was always that easy.... 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/6/2026 4:28:38 AM. PLT: 0s