G
Guest
The following Insert statement gives me an error message when the last name
is Like "O'Brien". How should I change the formating to remove this error?
sql = "insert into data_BCFP (BCFP_ID,last_name,
middle_name,First_name,birth_day,secondary_id,comm_id,Marital_status,gender,title,suffix,BCFP_Type,Denomination,occupation)" & _
"select" & "'" & M_bcfp_id & "'," & "'" & M_last_name & "'," & "'"
& M_Middle_name & "'," & "'" & M_first_name & "'," & "'" & M_Birth_day & "',"
& "'" & M_secondary_id & "'," & "'" & M_Comm_id & "'," & "'" &
M_Marital_status & "'," & "'" & M_gender & "'," & "'" & M_Title & "','" &
M_Suffix & "'," & "'" & M_BCFP_TYPE & "'," & "'" & M_Denomination & "'," &
"'" & M_Ocupation & "'"
DoCmd.RunSQL sql
is Like "O'Brien". How should I change the formating to remove this error?
sql = "insert into data_BCFP (BCFP_ID,last_name,
middle_name,First_name,birth_day,secondary_id,comm_id,Marital_status,gender,title,suffix,BCFP_Type,Denomination,occupation)" & _
"select" & "'" & M_bcfp_id & "'," & "'" & M_last_name & "'," & "'"
& M_Middle_name & "'," & "'" & M_first_name & "'," & "'" & M_Birth_day & "',"
& "'" & M_secondary_id & "'," & "'" & M_Comm_id & "'," & "'" &
M_Marital_status & "'," & "'" & M_gender & "'," & "'" & M_Title & "','" &
M_Suffix & "'," & "'" & M_BCFP_TYPE & "'," & "'" & M_Denomination & "'," &
"'" & M_Ocupation & "'"
DoCmd.RunSQL sql