Datatype Mismatch using integer

G

GMC -LSND

Using Access 2007 and receiving data from SQL server 2008

Hello all,

I am having problems with a data type mismatch in criteria expression (3464)
error. I am taking an integer value and passing it from one table into a
field that is set as an integer in another table. I then have an access
form with that field in it. I have a double click function on the field that
says (in part) as follows:

If Me!ErrorMsg = "Time Records Wrong" Then
DoCmd.OpenForm "inpTime", acNormal, , "TTIME.TIMEID ="" & Me!TIMEID & """

The records show up just fine, but when I go to open the record it gives me
the error above. I believe the problem is in this part: "TTIME.TIMEID = "" &
Me!TIMEID & """

Can someone straighten me out?
 
D

Douglas J. Steele

If TIMEID is an integer field, remove the extra quotes:

DoCmd.OpenForm "inpTime", acNormal, , "TTIME.TIMEID =" & Me!TIMEID

Actually, the quotes were wrong if TIMEID was a text field:

DoCmd.OpenForm "inpTime", acNormal, , "TTIME.TIMEID =""" & Me!TIMEID & """"

That's three double quotes in front, and four double quotes after (you had
two and three respectively)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Data Mismatch in Excel 2010 4
Datatype Mismatch Error 1
Trying to add Long Integer field 1
Data type mismatch? 5
Type Mismatch 4
Datatype Mismatch Error 1
Error 13 - Type Mismatch 1
Data type mismatch 2

Top