
why am I getting this error??
Any time you need to include double quotes within a string, you need to
double them:
docmd.RunSQL "UPDATE E "& _
"SET E.[Other Chg Item] = IIf([E]![Component ID]=""LABOR"" Or
[E]![Component ID]=""SUPPLY"",""Y"",""N"");"
Alternatively, you could try changing the internal double quotes to single
quotes:
docmd.RunSQL "UPDATE E "& _
"SET E.[Other Chg Item] = IIf([E]![Component ID]='LABOR' Or
[E]![Component ID]='SUPPLY','Y','N');"
HTH
--
Doug Steele, Microsoft Access MVP
http://i.am/DougSteele/
Quote:
> Dirk,
> Thank you for the tip...I'll try it. In the meatime, I have yet ANOTHER
error!
> Again, pasted from sql and works in the query.
> Error: Expected:End of Statement
> (highlights "LABOR")
> docmd.RunSQL "UPDATE E "& _
> "SET E.[Other Chg Item] = IIf([E]![Component ID]="LABOR" Or
> [E]![Component ID]="SUPPLY","Y","N");"
> I see why it's doing it, but how do I use the IIf without the "'s?
> Thanks,
> Angi