D
Dan B
Hi;
I have some code that adds data to a table from a
dropdown list from the "not in list" event. Looks like
this:
Private Sub Txt_Cat_NotInList(NewData As String, Response
As Integer)
Dim ctl As Control
If MsgBox("Issue Category is not in list. Add it?",
vbOKCancel) = vbOK Then
Response = acDataErrAdded
Cat_Title = Txt_Cat
CurrentDb.Execute "INSERT INTO ICategory
(Cat_Title) VALUES ('" & NewData & "')"
Else
Response = acDataErrContinue
End If
End Sub
My problem: When I try to add text that contains an
apostrophe " ' ", I get an error message which really
doesn't surprise me. How can I change the values
statement to accept text such as "Mom's apple pie"?
Thanks,
Dan
I have some code that adds data to a table from a
dropdown list from the "not in list" event. Looks like
this:
Private Sub Txt_Cat_NotInList(NewData As String, Response
As Integer)
Dim ctl As Control
If MsgBox("Issue Category is not in list. Add it?",
vbOKCancel) = vbOK Then
Response = acDataErrAdded
Cat_Title = Txt_Cat
CurrentDb.Execute "INSERT INTO ICategory
(Cat_Title) VALUES ('" & NewData & "')"
Else
Response = acDataErrContinue
End If
End Sub
My problem: When I try to add text that contains an
apostrophe " ' ", I get an error message which really
doesn't surprise me. How can I change the values
statement to accept text such as "Mom's apple pie"?
Thanks,
Dan