Hello,
I am having trouble getting my DB to recognize and accept an apostrophe in the ("FA_Email_Address"). Once I click the "send Email" button on my form it gives me an error because the "client_Name" or ("FA_Email_Address") has an apostrphe. If there is not an apostrophe present the code will run fine and the email will be sent.
Could someone please take a look at my code and let me know what I am going wrong or what I can add?
While Not rs.EOF
sqlinsert = "INSERT INTO Pending_Tbl (Account_Number, Client_Name, Branch, Primary_FA_num, New_Subcategory_ID, DT_Code_Changed, Email,Dt_contract_Received,Pending_Notes) VALUES ('" & rs.Fields("Account_Number") & "','" & rs.Fields("Client_Name") & "', '" & rs.Fields("Branch") & "', '" & rs.Fields("Primary_FA_num") & "', '" & rs.Fields("New_Subcategory_ID") & "', '" & rs.Fields("DT_Code_Changed") & "', '" & rs.Fields("FA_Email_Address") & "', '" & rs.Fields("Dt_Contract_Received") & "', '" & rs.Fields("Pending_Notes") & "');"
db.Execute (sqlinsert)
rs.MoveNext
Wend
I am having trouble getting my DB to recognize and accept an apostrophe in the ("FA_Email_Address"). Once I click the "send Email" button on my form it gives me an error because the "client_Name" or ("FA_Email_Address") has an apostrphe. If there is not an apostrophe present the code will run fine and the email will be sent.
Could someone please take a look at my code and let me know what I am going wrong or what I can add?
While Not rs.EOF
sqlinsert = "INSERT INTO Pending_Tbl (Account_Number, Client_Name, Branch, Primary_FA_num, New_Subcategory_ID, DT_Code_Changed, Email,Dt_contract_Received,Pending_Notes) VALUES ('" & rs.Fields("Account_Number") & "','" & rs.Fields("Client_Name") & "', '" & rs.Fields("Branch") & "', '" & rs.Fields("Primary_FA_num") & "', '" & rs.Fields("New_Subcategory_ID") & "', '" & rs.Fields("DT_Code_Changed") & "', '" & rs.Fields("FA_Email_Address") & "', '" & rs.Fields("Dt_Contract_Received") & "', '" & rs.Fields("Pending_Notes") & "');"
db.Execute (sqlinsert)
rs.MoveNext
Wend