B
Bill Stanton
In the following segment of code:
NewWorksSQL = "INSERT INTO [Works](Title,compid,orchid,condid,genreid"
NewWorksSQL = NewWorksSQL & ",soloid,volid,PlayingTime,LastPlayed)"
NewWorksSQL = NewWorksSQL & " VALUES(""" & WorksTitle & """, " & CompID
& ", " & OrchID & ", "
NewWorksSQL = NewWorksSQL & CondID & ", " & GenreID & ", " & SoloID & ",
"
NewWorksSQL = NewWorksSQL & VolID & ", """ & TTime & """, " & LastPlayed
& ")"
CurrentDb.Execute NewWorksSQL, dbFailOnError
the Execute fails if the user enters a quoted string
amidst the textbox "WorksTitle". I understand why
it fails, but I don't know how to fix it.
Do I have to parse the string entered by the user
and make substitutions using the Chr function?
(Got to be a better way than that... I hope)
Thanks,
Bill
NewWorksSQL = "INSERT INTO [Works](Title,compid,orchid,condid,genreid"
NewWorksSQL = NewWorksSQL & ",soloid,volid,PlayingTime,LastPlayed)"
NewWorksSQL = NewWorksSQL & " VALUES(""" & WorksTitle & """, " & CompID
& ", " & OrchID & ", "
NewWorksSQL = NewWorksSQL & CondID & ", " & GenreID & ", " & SoloID & ",
"
NewWorksSQL = NewWorksSQL & VolID & ", """ & TTime & """, " & LastPlayed
& ")"
CurrentDb.Execute NewWorksSQL, dbFailOnError
the Execute fails if the user enters a quoted string
amidst the textbox "WorksTitle". I understand why
it fails, but I don't know how to fix it.
Do I have to parse the string entered by the user
and make substitutions using the Chr function?
(Got to be a better way than that... I hope)
Thanks,
Bill