Revenir à la ligne dans l'éditeur VBA sous Access

UnknowVBA -  
 Utilisateur anonyme -
Bonjour,

Je souhaite revenir à la ligne lorsque je fais une requête SQL dans l'éditeur mais je n'y arrive pas... Voici les lignes de 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) & ");"


Le retour à la ligne se fait à ce niveau là mais j'ai des problèmes de guilemets... : " & Str(JourFeriee_11) & "," & _
"& Str(JourFeriee_12) & "

2 réponses

  1. f894009 Messages postés 17417 Date d'inscription   Statut Membre Dernière intervention   1 717
     
    Bonjour,

    retour a la ligne ok, mais la structure n'est pas bonne
    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) & ");"


    regardez ceci:
    requete insert into
    https://sql.sh/cours/insert-into
    0
  2. Utilisateur anonyme
     
    Bonjour,

    moi ces & _ j'en suis allergique...

    Voici ce que je fais, et c'est bien + lisible

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

    etc...

    A+
    Quand Jimmy dit What'd I say 
    I love you baby 
    C'est comme qui dirait 
    Toute la province qui chante en anglais
    0