Hi
Not been able to test this (not at work today) but
think this might work.. You'll have have to play
around with it..
IIf(IsNull(rst!CallName), " ","'" & rst!CallName) & _
"','" & rst!HandlerName & "'," & rst!DogID & ")"
HTH
Mark
>
> Date: Tue, 06 Sep 2005 01:19:04 -0000
> From: "allisonrja" <[EMAIL PROTECTED]>
> Subject: how to handle quotes on insert
>
> I have this SQL statement
> strSQL = "Insert into tblTempArmBand " & _
> "(ArmBandSequence, ArmBandNumber, CallName,
> HandlerName, DogID) " & _
> "values (" & intLoop & ",""" & rst!ArmBandNumber &
> """,""" & _
> IIf(IsNull(rst!CallName), " ", rst!CallName) & _
> """,""" & rst!HandlerName & """," & rst!DogID & ")"
>
> I just ran into a situation where CallName = "D".
> Yes it has the
> quotes in the name. The SQL statement bombs because
> it looks like
> this...
> Insert into tblTempArmBand (ArmBandSequence,
> ArmBandNumber, CallName,
> HandlerName, DogID) values
> (110,"20134",""D"","Silvia King",355)
>
> It blows because of the ""D""
>
> What works better is
> Insert into tblTempArmBand (ArmBandSequence,
> ArmBandNumber, CallName,
> HandlerName, DogID) values
> (110,"20134",'"D"',"Silvia King",355)
>
> But how do I code for single quotes?
>
> Thanks,
>
> Rick
>
>
>
>
___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo!
Security Centre. http://uk.security.yahoo.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~->
Please zip all files prior to uploading to Files section.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessDevelopers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/