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
| Option Compare Database
Option Explicit
Private Sub Annuler_Click()
If CurrentProject.AllReports("Planning retard").IsLoaded Then
DoCmd.Close acReport, "Planning retard"
End If
If CurrentProject.AllReports("Planning visite").IsLoaded Then
DoCmd.Close acReport, "Planning visite"
End If
DoCmd.Close acForm, Me.Name 'ferme le formulaire en cours
DoCmd.OpenForm "Menu Etat" 'ouvre le formulaire menu états'
End Sub
Private Sub Aperçu_Click()
If CurrentProject.AllReports("Planning retard").IsLoaded Then
DoCmd.Close acReport, "planning retard"
End If
If CurrentProject.AllReports("Planning visite").IsLoaded Then
DoCmd.Close acReport, "planning visite"
End If
Select Case Me.ImprimerPlanningsPour
Case 1
DoCmd.OpenReport "Planning retard", acViewPreview
Case 2
DoCmd.OpenReport "Planning visite", acViewPreview, "", "[Commercial]like '" & Nz(Me.SélectionCommercial, "*") & "'"
End Select
End Sub
Private Sub Form_Unload(Cancel As Integer)
If CurrentProject.AllReports("Planning retard").IsLoaded Then
DoCmd.Close acReport, "Planning retard"
End If
If CurrentProject.AllReports("Planning visite").IsLoaded Then
DoCmd.Close acReport, "Planning visite"
End If
End Sub
Private Sub ImprimeFicheClient_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'ImprimeFicheClient_... est le nom du cadre
'Select case Me Voici le début de mon code pour le bouton.
End Sub
Private Sub Imprimer_Click()
If CurrentProject.AllReports("Planning retard").IsLoaded Then
DoCmd.Close acReport, "Planning retard"
End If
If CurrentProject.AllReports("Planning visite").IsLoaded Then
DoCmd.Close acReport, "Planning visite"
End If
Select Case Me.ImprimerPlanningsPour
Case 1
DoCmd.OpenReport "Planning retard", acViewNormal
Case 2
DoCmd.OpenReport "Planning visite", acViewNormal, "", "[Commercial]like '" & Nz(Me.SélectionCommercial, "*") & "'"
End Select
End Sub
Private Sub ImprimerPlanningsPour_AfterUpdate()
If Me.ImprimerPlanningsPour = 1 Then
Me.SélectionCommercial.Enabled = False
Else
Me.SélectionCommercial.Enabled = True
Me.SélectionCommercial.SetFocus
End If
End Sub |
Partager