473,326 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Data Type mismatch?!

48
The below code throws the error: "Data type mismatch in criteria expression"
Searching online didn't seem to offer me a solution.

Expand|Select|Wrap|Line Numbers
  1. Public Sub update_by_EDD(myDate As Date, myMR As String)
  2.      Dim rs As Object
  3.  
  4.      Set rs = Me.Recordset.Clone
  5.      ' strCriteria = "([myString] = '" & myMR & "')"
  6.      strCriteria = "([EDD] = '" & myDate & "')"
  7.      rs.FindFirst (strCriteria)
  8.  
  9. End Sub
Now, if I use the commented expression instead of the Date counterpart, it doesn't throw the error. For some reason, the Date expression is not well liked.

[EDD] is defined as a Date/Time in the corresponding Table. If I define it in the function as "myDate as String", the error remains. So, assuming that myDate is actually being read as a date due to the definition, how do I check [EDD]? Is there a handy way to debug data types?

Thank you in advance.
Aug 6 '07 #1
5 1952
Rabbit
12,516 Expert Mod 8TB
Replace the single quotes ( ' ) with pound signs ( # )
Aug 6 '07 #2
Stang02GT
1,208 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1.      ' strCriteria = "([myString] = '" & myMR & "')"
  2.  
  3. End Sub
Try taking the single quotes out. Just use the double quotes. I think your error has to do with what data type myMR is.
Aug 6 '07 #3
isoquin
48
Thanky ou rabbit, worked like a charm.

Thank you too, stang, I appreciate the efforts of anyone willing to help. =)
Aug 6 '07 #4
Stang02GT
1,208 Expert 1GB
Your welcome. I had the same error before and my solution had to do with how i was using the quotes. Good to see that you got your answer :)
Aug 6 '07 #5
Rabbit
12,516 Expert Mod 8TB
Thanky ou rabbit, worked like a charm.

Thank you too, stang, I appreciate the efforts of anyone willing to help. =)
EDD is a date. Anything in quotes is considered text. Anything out of quotes is considered either a number or a variable. Anything in pound signs is considered a date.
Aug 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: LJgrnl | last post by:
I've got a type mismatch error that's driving me nutty. Variable blnNoData has the initial value False. If a recordset comes back empty (both .EOF and ..BOF are true) then blnNoData is set to...
1
by: deko | last post by:
Okay, so I figured out how to pull Outlook Appointments into an Access Table (see below). But the data comes in the wrong Data Type - how do I convert it from Text to Long Integer? For...
2
by: Chicken Kebab Abdullah | last post by:
Does anyone know why I get the error 3464 Data type mismatch from the following code. I have a form with a combo(to choose a consumable) and 2 list boxes on it. list on left is all printers...
0
by: news.paradise.net.nz | last post by:
I have been developing access databases for over 5 years. I have a large database and I have struck this problem with it before but can find nothing in help or online. Access 2000 I have a query...
1
by: ArcadeJr | last post by:
Good morning all! I have been getting a Run-time Error message #3464 - Data Type mismatch in criteria expression. While trying to run a query. I have a database where the field Asset_Number...
3
by: Jake | last post by:
I am currently trying to create my own Point Of Sale software for my retail store. I wrote the program with the UPC field as Long integer. When I started to add the products by UPC code, I got a...
1
by: amitbadgi | last post by:
I am getting the following error while converting an asp application to asp.net Exception Details: System.Runtime.InteropServices.COMException: Data type mismatch in criteria expression. ...
2
by: psychomad | last post by:
Please, can someone help me out to solve this error, i've been searching throughout my codes and yet i didnt succeed in finding the error!!!! The Error is: Server Error in '/' Application....
15
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the...
19
by: Lysander | last post by:
I have written a query that takes three integers representing day,month and year, forms a date from them and compares this date to the date the record was entered and returns any records where the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.