Before you build up the SQL string for the query, double the quotes in the name.
Here's a code example for a function to do this, I use it all the time.
'Begin of code sample
Public Function DoubleQuotes(s As String) As String
Dim a As String, b As String, i As Integer
If Len(s) = 0 Then DoubleQuotes = "": Exit Function
a = "": b = ""
For i = 1 To Len(s)
b = Mid(s, i, 1)
If b = "'" Then b = "''"
a = a & b
Next
DoubleQuotes = a
End Function
'End of code sample
A SQL string would then look like:
strSQL = SELECT * FROM People WHERE Name = '" & DoubleQuotes(strName) & "'"