Datatype Mismatch using integer

  • Thread starter Thread starter GMC -LSND
  • Start date Start date
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?
 
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)
 
Back
Top