Line break in the VBA editor in Access

UnknowVBA -  
 Anonymous user -
Hello,

I want to create a line break when I execute a SQL query in the editor, but I'm having trouble with it... Here are the lines of code:

StrSQL1 = "INSERT INTO ...." & Str(JourFeriee_10) & ", " & Str(JourFeriee_11) & "," & _
"& Str(JourFeriee_12) & ", " & Str(JourFerieeTotalMois3) & "," " & Str(JourAutre1) & ", " & Str(JourAutre2) & ", " & Str(JourAutre3) & ", " & Str(JourAutre4) & ", " & Str(JourAutreTotalMois1) & ", " & Str(JourAutre5) & ", " & Str(JourAutre6) & ", " & Str(JourAutre7) & ", " & Str(JourAutre8) & ", " & Str(JourAutreTotalMois2) & ", " & Str(JourAutre9) & ", " & Str(JourAutre10) & ", " & Str(JourAutre11) & ", " & Str(JourAutre12) & ", " & Str(JourAutreTotalMois3) & ", " & Str(TotalGeneral) & ");"


The line break occurs at this point, but I have problems with the quotes... : " & Str(JourFeriee_11) & "," & _
"& Str(JourFeriee_12) & "

Configuration: Windows 7 / Chrome 52.0.2743.116

2 answers

  1. f894009 Posted messages 17417 Registration date   Status Member Last intervention   1 717
     
    Hello,

    line breaks are fine, but the structure is not correct
    StrSQL1 = "INSERT INTO ...." & Str(HolidayDay_10) & ", " & Str(HolidayDay_11) & "," & _ Str(HolidayDay_12) & ", " & Str(HolidayTotalMonth3) & "," & _ Str(OtherDay1) & ", " & Str(OtherDay2) & ", " & Str(OtherDay3) & ", " & _ Str(OtherDay4) & ", " & Str(OtherTotalMonth1) & ", " & Str(OtherDay5) & ", " & _ Str(OtherDay6) & ", " & Str(OtherDay7) & ", " & Str(OtherDay8) & ", " & _ Str(OtherTotalMonth2) & ", " & Str(OtherDay9) & ", " & Str(OtherDay10) & ", " & _ Str(OtherDay11) & ", " & Str(OtherDay12) & ", " & Str(OtherTotalMonth3) & ", " & Str(TotalGeneral) & ");"


    look at this:
    insert into
    https://sql.sh/cours/insert-into
    0
  2. Anonymous user
     
    Hello,

    I'm allergic to these & _...

    Here’s what I do, and it’s much more readable

    StrSQL1 = "INSERT INTO ...." StrSQL1 StrSQL1 & 'Str(JourFeriee_10)' & " " & StrSQL1=StrSQL1 & Str(JourFeriee_11) 

    etc...

    See you
    When Jimmy says What'd I say
    I love you baby
    It’s like saying
    The whole province singing in English
    0