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
| Private Sub listeimpression_AfterUpdate()
DoCmd.RunCommand acCmdRefresh
On Error GoTo Err_listeimpression_Click
If listeimpression = 5 Then
DoCmd.SetWarnings False
'DoCmd.RunSQL "DELETE stat_reserve.* FROM stat_reserve;"
'DoCmd.RunSQL "INSERT INTO stat_reserve ( BATIMENT_LOGE, NUM_ENTREPRISE, nombre, NUM_LOGE ) SELECT LOGEMENT.BATIMENT_LOGE, LOGEMENT_TS_RESERVE.NUM_ENTREPRISE, Count(LOGEMENT_TS_RESERVE.NUM_TS_RESERVE) AS nombre, LOGEMENT.NUM_LOGE FROM LOGEMENT INNER JOIN LOGEMENT_TS_RESERVE ON (LOGEMENT.NUM_OPERATION = LOGEMENT_TS_RESERVE.NUM_OPERATION) AND (LOGEMENT.NUM_LOGEAUTO = LOGEMENT_TS_RESERVE.NUM_LOGEAUTO) GROUP BY LOGEMENT.BATIMENT_LOGE, LOGEMENT_TS_RESERVE.NUM_ENTREPRISE, LOGEMENT_TS_RESERVE.NUM_OPERATION, LOGEMENT_TS_RESERVE.TYPE_TS_RESERVE, LOGEMENT.NUM_LOGE HAVING (((LOGEMENT_TS_RESERVE.NUM_OPERATION)=[Forms]![Gestion des réserves]![NUM_OPERATION]) AND ((LOGEMENT_TS_RESERVE.TYPE_TS_RESERVE)='reserve') AND ((LOGEMENT.NUM_LOGE)<>'pc'));"
DoCmd.SetWarnings True
Dim stDocName5 As String
stDocName5 = "analyse croise bat appart entreprise"
DoCmd.OpenReport stDocName5, acPreview
Else
If listeimpression = 10 Then
DoCmd.SetWarnings False
'DoCmd.RunSQL "DELETE stat_reserve.* FROM stat_reserve;"
'DoCmd.RunSQL "INSERT INTO stat_reserve ( BATIMENT_LOGE, NUM_ENTREPRISE, nombre ) SELECT [regroupe com bat entreprise].BATIMENT_LOGE, [regroupe com bat entreprise].NUM_ENTREPRISE, [regroupe com bat entreprise].nombre FROM [regroupe com bat entreprise];"
DoCmd.SetWarnings True
Dim stDocName10 As String
stDocName10 = "analyse croise bat com entreprise"
DoCmd.OpenReport stDocName10, acPreview
End If
End If
Exit_listeimpression_Click:
Exit Sub
Err_listeimpression_Click:
Resume Exit_listeimpression_Click
End Sub |
Partager