Right now, I have a form that users can fill out and send e-mails from. It's supposed to save the body, subject, date, etc. when every e-mail is sent. I've been doing this with an SQL statement that is built in VBA.
So, something like:
"INSERT INTO [tbl: History] ([Body], [Subject], [Date]) VALUES ('" & body & "', " & subject & ", #" & Date & "#)"
where body and subject are local variables.
It works fine, but the problem is when a user puts single or double quotes in the body or subject. It gets interpreted in weird ways and the statement breaks.
Is there a way I can surround body and subject so it really knows what they are (I was thinking like a triple or quadruple quote, if they existed)?
If not, is there a good way to do this?
So, something like:
"INSERT INTO [tbl: History] ([Body], [Subject], [Date]) VALUES ('" & body & "', " & subject & ", #" & Date & "#)"
where body and subject are local variables.
It works fine, but the problem is when a user puts single or double quotes in the body or subject. It gets interpreted in weird ways and the statement breaks.
Is there a way I can surround body and subject so it really knows what they are (I was thinking like a triple or quadruple quote, if they existed)?
If not, is there a good way to do this?