Error 3075 occurs when doing query with apostrophe

G

Guest

This is my module...
Private Sub cmbUID_Change()

Dim i As Integer
Dim strNewID As String
strUID = cmbUID.Value

If strUID = "New" Then

strSel = MsgBox("Would you really like to add a new user id?",
vbYesNo + vbQuestion, "User ID Verification")
If strSel = vbYes Then
'get new user settings
'select folders where emails are kept
i = 1
While i <= 3
Call GetNewUserFolders(i)
i = i + 1
Wend
strNewID = InputBox("Please enter your corporate ID number...",
"New User ID set up")

'stripp strings
Call stripStrings

strSQL = "INSERT INTO tblSettings(fldCorpID, fldSummary,
fldDetail, fldDNIS) values ('" & strNewID & "', '" & Summaryfoldername & "',
'" & Detailedfoldername & "', '" & DNISfoldername & "')"
CurrentDb.Execute strSQL
cmbUID.Requery

MsgBox "User ID " & strNewID & " settings have been added to the
application. Now please select your user ID from the user ID list", vbOKOnly
+ vbExclamation, "New User Successful"

End If
End If

Call getChkValues(True, 0)
End Sub

The whole module works fine the problem is with my SQL query...it works but
when it has to deal with strings that have apostrophe's it breaks! it gives
me the Run-time error 3075 (I found this through google, but have not been
able to find a solution to it)...Does anyone have any idea how to handle sql
queries with string variables that have apostrophes in them?

Many thanks in advance...
 
G

Guest

Nevermind...I found something here I was just not searching with the right
strings...if you have a similar situation you can find the solution on the
thread with the subject Subject: Re: INSERT Query problem with Quotes &
Apostrophes 10/7/2004 5:08 AM PST...

Thanks anyway!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top