K
kaosyeti via AccessMonster.com
i have an insert into SQL issue where a user may be using an apostrophe and
it's messing with the SQL. here's the code:
strSQL = "insert into tblNewoptions (optiondesc, optionCode, AllocGroup)
values('" & Me.txtboxOption & "'" & ", '" & Me.txtboxOptionCode & "'" & ", '"
& Me.txtboxAllocGroup & "')"
and here's the debug.print line from it:
insert into tblNewoptions (optiondesc, optionCode, AllocGroup) values('Power
Driver's Seat', 'AE8', '123987')
it's the driver's part that is messing things up, obviously. i know there
are numerous tricks with doubling-up the apostrophe but how do i use that
trick when there won't always be one in the corresponding textbox? Thanks
for your help!
Greg
it's messing with the SQL. here's the code:
strSQL = "insert into tblNewoptions (optiondesc, optionCode, AllocGroup)
values('" & Me.txtboxOption & "'" & ", '" & Me.txtboxOptionCode & "'" & ", '"
& Me.txtboxAllocGroup & "')"
and here's the debug.print line from it:
insert into tblNewoptions (optiondesc, optionCode, AllocGroup) values('Power
Driver's Seat', 'AE8', '123987')
it's the driver's part that is messing things up, obviously. i know there
are numerous tricks with doubling-up the apostrophe but how do i use that
trick when there won't always be one in the corresponding textbox? Thanks
for your help!
Greg