1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
|
Private Sub Cmd_recherche_annee_Click()
'Déclaration des variables
Dim sql_annee As String
Dim rs As dao.Recordset
Dim sql_synth As String
Dim rs_synth As dao.Recordset
Dim tmp_mois_pose As Integer, tmp_mois_depose As Integer, temp_urgence As Integer
Dim temp_mois_pose As String, temp_mois_depose As String, temp_bordereau As String, temp_entreprise As String, temp_batiment As String, temp_echafaudage As String
Dim Nb_jrs As Integer, Annee_depose As Integer, temp_ech_30 As Integer, temp_hpl As Single
Dim temp_longueur As Single, temp_largeur As Single, temp_hauteur As Single, temp_volume As Single
Dim ech_1_20 As Single, ech_20 As Single, temp_prevenance As Integer
'On supprime les enregistrements des tables avant de les remettre à jour
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM T_synthese;"
DoCmd.RunSQL "DELETE * FROM T_synth;"
'***************************************** T_SYNTHESE BEGIN ********************************************************
sql_annee = "SELECT * FROM T_bordereau LEFT JOIN T_echafaudage ON T_bordereau.Numero_bordereau = T_echafaudage.Numero_bordereau WHERE (((Year([T_echafaudage].[date_pose]))=" & Me.Annee & " ) AND T_bordereau.Avenant = 1);"
Set rs = CurrentDb.OpenRecordset(sql_annee)
If Not rs.EOF Then
'on se positionne sur le premier enregistrement
rs.MoveFirst
'On boucle sur chaque enregistrement
While Not rs.EOF
'on récupère le numéro de bordereau
temp_bordereau = ""
temp_bordereau = rs("T_bordereau.numero_bordereau")
'on récupère le numéro d'échafaudage
temp_echafaudage = ""
temp_echafaudage = rs("numero_echafaudage")
'on récupère et teste le mois de pose
tmp_mois_pose = 0
temp_mois_pose = ""
' If Not IsNull(rs("T_echafaudage.date_pose")) Then
If rs("T_echafaudage.date_pose") <> "" Then
tmp_mois_pose = Month(rs("T_echafaudage.date_pose"))
Select Case tmp_mois_pose
Case 1
temp_mois_pose = "Janvier"
Case 2
temp_mois_pose = "Février"
Case 3
temp_mois_pose = "Mars"
Case 4
temp_mois_pose = "Avril"
Case 5
temp_mois_pose = "Mai"
Case 6
temp_mois_pose = "Juin"
Case 7
temp_mois_pose = "Juillet"
Case 8
temp_mois_pose = "Août"
Case 9
temp_mois_pose = "Septembre"
Case 10
temp_mois_pose = "Octobre"
Case 11
temp_mois_pose = "Novembre"
Case 12
temp_mois_pose = "Décembre"
End Select
End If
'on récupère et teste le mois de dépose
tmp_mois_depose = 0
temp_mois_depose = ""
Nb_jrs = 0
' If Not IsNull(rs("T_echafaudage.date_demande_depose")) Then
If rs("T_echafaudage.date_demande_depose") <> "" Then
tmp_mois_depose = Month(rs("T_echafaudage.date_demande_depose"))
Select Case tmp_mois_pose
Case 1
temp_mois_depose = "Janvier"
Case 2
temp_mois_depose = "Février"
Case 3
temp_mois_depose = "Mars"
Case 4
temp_mois_depose = "Avril"
Case 5
temp_mois_depose = "Mai"
Case 6
temp_mois_depose = "Juin"
Case 7
temp_mois_depose = "Juillet"
Case 8
temp_mois_depose = "Août"
Case 9
temp_mois_depose = "Septembre"
Case 10
temp_mois_depose = "Octobre"
Case 11
temp_mois_depose = "Novembre"
Case 12
temp_mois_depose = "Décembre"
End Select
Annee_depose = Year(rs("T_echafaudage.date_demande_depose"))
'Calcul du nombre de jour entre la date de pose et la date de dépose
Nb_jrs = DateDiff("d", rs("T_echafaudage.date_pose"), rs("T_echafaudage.date_demande_depose"))
If Nb_jrs < 0 Then
Nb_jrs = 0
End If
End If
'Si le nombre de jours entre la date de pose et la date de dépose est supérieur à 30 jours
temp_ech_30 = 0
If Nb_jrs > 30 Then
temp_ech_30 = 1
End If
'on récupère le coef d'urgence
'Si la case est cochée (valeur = -1)
temp_urgence = 0
If rs("coef_K7") = -1 Then
temp_urgence = 1
End If
'on récupère la hauteur HPL (hauteur du plancher) --> correspond à la hauteur du garde corps - 1mètre
temp_hpl = 0
If rs("hauteur") > 0 Then
temp_hpl = rs("hauteur") - 1
If temp_hpl < "1,5" Then
temp_hpl = 1
Else
temp_hpl = 0
End If
End If
'on récupère le produit de la Longueur x Largeur x Hauteur (surface)
temp_hauteur = 0
temp_largeur = 0
temp_longueur = 0
temp_volume = 0
ech_1_20 = 0
ech_20 = 0
If (rs("hauteur") > 0 And rs("largeur") > 0 And rs("longueur") > 0) Then
temp_hauteur = rs("hauteur")
temp_largeur = rs("largeur")
temp_longueur = rs("longueur")
temp_volume = temp_longueur * temp_largeur * temp_hauteur
If (temp_volume > 1 And temp_volume < 20) Then
ech_1_20 = 1
End If
If temp_volume > 20 Then
ech_20 = 1
End If
End If
temp_entreprise = ""
temp_batiment = ""
If rs("nom_entreprise") <> "" Then
temp_entreprise = rs("nom_entreprise")
End If
If rs("nom_batiment") <> "" Then
temp_batiment = rs("nom_batiment")
End If
'on récupère la prévenance
'Si la case est cochée (valeur = -1)
temp_prevenance = 0
If rs("coef_K6") = -1 Then
temp_prevenance = 1
End If
'On insère les données dans la table T_Synthese
'Si l'entreprise et le batiment sont reneignés
If (temp_entreprise <> "" And temp_batiment <> "") Then
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synthese (numero_bordereau,numero_echafaudage,mois_pose,mois_depose,urgence,entreprise,batiment,annee_pose,annee_depose,Nb_jrs,ech_30,hpl,ech_1_20,ech_20,prevenance) VALUES('" & temp_bordereau & "', '" & temp_echafaudage & "','" & temp_mois_pose & "', '" & temp_mois_depose & "', " & temp_urgence & ", '" & temp_entreprise & "', '" & temp_batiment & "', " & Me.Annee & "," & Annee_depose & ", " & Nb_jrs & ", " & temp_ech_30 & ", '" & temp_hpl & "', '" & ech_1_20 & "', '" & ech_20 & "', '" & temp_prevenance & "' );"
End If
'on passe à l'enregistrement suivant
rs.MoveNext
Wend
Else
MsgBox "Année non trouvée ", vbInformation, "Année"
End If
rs.Close
Set rs = Nothing
'***************************************** T_SYNTHESE END *********************************************************
'***************************************** T_SYNTH BEGIN ***********************************************************
sql_synth = "SELECT * FROM T_Synthese ;"
Set rs_synth = CurrentDb.OpenRecordset(sql_synth)
'Variables mois de pose
Dim mois_1_p As Integer, mois_2_p As Integer, mois_3_p As Integer, mois_4_p As Integer, mois_5_p As Integer, mois_6_p As Integer, mois_7_p As Integer, mois_8_p As Integer, mois_9_p As Integer, mois_10_p As Integer, mois_11_p As Integer, mois_12_p As Integer
'Variables mois de dépose
Dim mois_1_dp As Integer, mois_2_dp As Integer, mois_3_dp As Integer, mois_4_dp As Integer, mois_5_dp As Integer, mois_6_dp As Integer, mois_7_dp As Integer, mois_8_dp As Integer, mois_9_dp As Integer, mois_10_dp As Integer, mois_11_dp As Integer, mois_12_dp As Integer
Dim temp_taux_urgence As Single, temp_taux_prevenance As Single
'Variables texte information
Dim info1 As String, info2 As String, info3 As String, info4 As String, info5 As String, info6 As String, info7 As String, info8 As String, info9 As String, info10 As String, info11 As String
info1 = " Nb Ech Dém"
info2 = " Nb Ech Mon"
info3 = " Nb Urgences"
info4 = "Taux Urgence"
info5 = "Prévenance >= 4j"
info6 = "Taux Prévenance"
info7 = "Nb Echaf avec HPL < 1.5m"
info8 = "Nb Ech entre 1 et 20m2"
info9 = "Nb Ech > 20m2"
info10 = "Nb Ech > 30j"
info11 = "Durée vie moyenne"
If Not rs_synth.EOF Then
'on se positionne sur le premier enregistrement
rs_synth.MoveFirst
'On boucle sur chaque enregistrement
While Not rs_synth.EOF
'Cas mois dépose
mois_1_dp = 0
mois_2_dp = 0
mois_3_dp = 0
mois_4_dp = 0
mois_5_dp = 0
mois_6_dp = 0
mois_7_dp = 0
mois_8_dp = 0
mois_9_dp = 0
mois_10_dp = 0
mois_11_dp = 0
mois_12_dp = 0
Select Case rs_synth("mois_depose")
Case "Janvier"
mois_1_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_1_dp & " );"
Case "Fevrier"
mois_2_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_2_dp & " );"
Case "Mars"
mois_3_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_3_dp & " );"
Case "Avril"
mois_4_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_4_dp & " );"
Case "Mai"
mois_5_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_5_dp & " );"
Case "Juin"
mois_6_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_6_dp & " );"
Case "Juillet"
mois_7_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_7_dp & " );"
Case "Août"
mois_8_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_8_dp & " );"
Case "Septembre"
mois_9_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_9_dp & " );"
Case "Octobre"
mois_10_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_10_dp & " );"
Case "Novembre"
mois_11_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_11_dp & " );"
Case "Décembre"
mois_12_dp = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "', " & mois_12_dp & " );"
Case Else
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info1 & "' );"
End Select
'Cas mois pose
mois_1_p = 0
mois_2_p = 0
mois_3_p = 0
mois_4_p = 0
mois_5_p = 0
mois_6_p = 0
mois_7_p = 0
mois_8_p = 0
mois_9_p = 0
mois_10_p = 0
mois_11_p = 0
mois_12_p = 0
temp_taux_urgence = 0
temp_taux_prevenance = 0
Select Case rs_synth("mois_pose")
Case "Janvier"
mois_1_p = 1
'On insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_1_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Janvier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Fevrier"
mois_2_p = 1
'On insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_2_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Fevrier) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Mars"
mois_3_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_3_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mars) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Avril"
mois_4_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_4_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Avril) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Mai"
mois_5_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_5_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Mai) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Juin"
mois_6_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_6_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juin) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Juillet"
mois_7_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_7_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Juillet) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Août"
mois_8_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_8_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Aout) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Septembre"
mois_9_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_9_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Septembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Octobre"
mois_10_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_10_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Octobre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Novembre"
mois_11_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_11_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Novembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
Case "Décembre"
mois_12_p = 1
'on insère les données dans la table T_Synth
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info2 & "', " & mois_12_p & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info3 & "', " & rs_synth("urgence") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info5 & "', " & rs_synth("prevenance") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info7 & "', " & rs_synth("Hpl") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info8 & "', " & rs_synth("Ech_1_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info9 & "', " & rs_synth("Ech_20") & " );"
DoCmd.RunSQL "INSERT INTO T_synth (S_Entreprise,S_batiment,S_information,S_Decembre) VALUES('" & rs_synth("entreprise") & "', '" & rs_synth("batiment") & "','" & info10 & "', " & rs_synth("Ech_30") & " );"
End Select
'on passe à l'enregistrement suivant
rs_synth.MoveNext
Wend
End If
rs_synth.Close
Set rs_synth = Nothing
'***************************************** T_SYNTH END **********************************************************
End Sub |
Partager