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
|
Private Sub Reporting_Click()
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Data", "d:\U463017\Bureau\Extraction_Essai.xls", True
Dim MyDateDebut As Date, MyDateFin As Date
Dim Txt As String
Dim Duree As Date
MyDateDebut = DTPicker1.Value
MyDateFin = DTPicker2.Value
If ComboBox1.Value = "" Then
MsgBox "Veuillez selectionner un reseau"
Else: Txt = ComboBox1.Value
Select Case Txt
Case 1
Txt = "Hyper"
SQL = "SELECT Réseau.Data FROM Data UNION Date.Data From DATA WHERE Réseau= 'Hyper' AND Duree Between MyDateDebut AND MyDAteFin;"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Data", "d:\U463017\Bureau\Reporting_HebdoHyper.xls", True
Case 2
Txt = "Super"
SQL = "SELECT Réseau.Data FROMData UNION Date.Data From DATA WHERE Réseau= 'Super' AND Duree Between MyDateDebut AND MyDAteFin ;"
'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Data", "d:\U463017\Bureau\Reporting_HebdoSuper.xls", True
Case 3
Txt = "Proxi"
SQL = "SELECT Réseau.Data FROM Data UNION Date.Data From DATA WHERE Réseau= 'Proxi' AND Duree Between MyDateDebut AND MyDAteFin;"
'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Data", "d:\U463017\Bureau\Reporting_HebdoProxi.xls", True
End Select
End If
If MyDateDebut < MyDateFin Then
MsgBox " Resaisissez la date fin"
End If |
Partager