Link to home
Start Free TrialLog in
Avatar of Dale Logan
Dale LoganFlag for United States of America

asked on

Type Mismatch must by syntax

I really struggle with these situations where I need to use " or '. The line below is giving me a type mismatch error. Both variables are numeric. Where am I going wrong?

CurrentDb.Execute "UPDATE tblGoals SET TargetShare = " & Me.TargetShare & " where Crop_ID = " & Me.CurrentCrop And Location_ID = " & Me.CurrentLocation &"
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If TargetShare is text, then:

CurrentDb.Execute "UPDATE tblGoals SET TargetShare = " & Chr(34) & Me.TargetShare & Chr(34) & " where Crop_ID = " & Me.CurrentCrop & " And Location_ID = " & Me.CurrentLocation





 
Is any of below fields a character type?
TargetShare
Crop_ID
Location_ID