I'm having some great difficulty with an SQL statement which is very long, I'm not sure if I'm using the right characters to continue the SQL statement to the next line :
At the end of each line should be :
" _
And the beginning of the next line should be :
& "
is that correct? Did I miss something in my code? Sorry, its 3am in the morning and I can't seem to think straight.
Code:
strsql = "INSERT INTO [Activity Details]" _
& "(Activity_ID, Activity_Name, Club_ID, term, [session teacher], [Number of support staff], [number of sessions], [running cost], [period/duration], [date of first session], [start time of session], [end time of session] , [jp contribution], [school contribution], [notes - preview], [notes - review], [notes - revision], [target gender], [traveller status], refugee, gifted, [ethnicity code], [sen status], [learning area]) VALUES " _
& " ('" & Activity_ID.Value & "','" & Activity_Name.Value & "','" & Club_ID.Value & "','" & Term & "','" & Session_Teacher & "','" & [Forms]![manage - club]![create_activity_subform]![Number_of_support_staff] & "','" & [Forms]![manage - club]![create_activity_subform]![Number_of_Sessions] & "','" & [Forms]![manage - club]![create_activity_subform]![Running_Cost] & "','" & [Forms]![manage - club]![create_activity_subform]![Duration] & "','" _
& first_session & " ','" & start_time & "','" & end_time & "','" & [Forms]![manage - club]![create_activity_subform].JP_Contribution.Value & "','" & [Forms]![manage - club]![create_activity_subform].School_Contribution.Value & "','" & [Forms]![manage - club]![create_activity_subform].Notes_Preview.Value & "','" & [Forms]![manage - club]![create_activity_subform].Notes_Review.Value & "','" & [Forms]![manage - club]![create_activity_subform].Notes_Revision.Value & "','" _
& [Forms]![manage - club]![create_activity_subform].Target_Gender.Value & " ','" & [Forms]![manage - club]![create_activity_subform].Traveller_Status.Value & "','" & [Forms]![manage - club]![create_activity_subform].Refugee.Value & "','" & [Forms]![manage - club]![create_activity_subform].Gifted.Value & "','" & [Forms]![manage - club]![create_activity_subform].Ethnicity_Code.Value & "','" & [Forms]![manage - club]![create_activity_subform].SEN_Status.Value & "','" & [Forms]![manage - club]![create_activity_subform].Learning_Area.Value & "')"
At the end of each line should be :
" _
And the beginning of the next line should be :
& "
is that correct? Did I miss something in my code? Sorry, its 3am in the morning and I can't seem to think straight.