Les Isaacs
Registered User.
- Local time
- Today, 06:16
- Joined
- May 6, 2008
- Messages
- 186
Hi All
This works:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "';"
and this works:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "' WHERE tblResults.athlete_number = 6;"
but this doesn't work:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "' WHERE tblResults.athlete_number = '" & thisAthleteNo & "';"
This fails with "Runtime error 3464 - data type mismatch in criteria expression".
The field 'athlete_number' in [tblResults] is of type Number (long integer).
Earlier in the function have:
Dim thisAthleteNo As Integer
and then:
thisAthleteNo = [No].Value
When I put a break point in the code on the DoCmd.RunSQL line, then hover over thisAthleteNo, it shows the expect integer value.
I'm sure this is a simple syntax error, but I've tried lots of alternatives but am now :banghead:
Hope someone can help.
Many thanks
Les
This works:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "';"
and this works:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "' WHERE tblResults.athlete_number = 6;"
but this doesn't work:
DoCmd.RunSQL "UPDATE tblResults SET tblResults.athlete_time = '" & prevTime & "' WHERE tblResults.athlete_number = '" & thisAthleteNo & "';"
This fails with "Runtime error 3464 - data type mismatch in criteria expression".
The field 'athlete_number' in [tblResults] is of type Number (long integer).
Earlier in the function have:
Dim thisAthleteNo As Integer
and then:
thisAthleteNo = [No].Value
When I put a break point in the code on the DoCmd.RunSQL line, then hover over thisAthleteNo, it shows the expect integer value.
I'm sure this is a simple syntax error, but I've tried lots of alternatives but am now :banghead:
Hope someone can help.
Many thanks
Les