1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub Commande2_Click()
Select Case Me.txtdate1 > 0 And Me.txtdate2 > 0
Case Me.chkfour = False And Me.chkrcpt = False
DoCmd.OpenReport "ListCommande", acViewPreview, "", "[DateCommande]>=[forms]![ChoixEtats]![txtDate1]" & " and [DateCommande]<=[forms]![ChoixEtats]![txtDate2]", acDialog
Case Me.chkrcpt = True
DoCmd.OpenReport "ListCommande", acViewPreview, "", "[DateCommande]>=[forms]![ChoixEtats]![txtDate1]" & " and [DateCommande]<=[forms]![ChoixEtats]![txtDate2]" & "and [Reçu]=false", acDialog
Case Me.chkfour = True
DoCmd.OpenReport "ListCommande", acViewPreview, "", "[NomFournisseur]=[Forms]![Menu]![lstfour]" & " and [DateCommande]>=[forms]![ChoixEtats]![txtDate1]" & " and [DateCommande]<=[forms]![ChoixEtats]![txtDate2]", acDialog
Case Me.chkrcpt = True And Me.chkfour = True
DoCmd.OpenReport "ListCommande", acViewPreview, "", "[NomFournisseur]=[Forms]![Menu]![lstfour]" & " and [DateCommande]>=[forms]![ChoixEtats]![txtDate1]" & " and [DateCommande]<=[forms]![ChoixEtats]![txtDate2]" & "and [Reçu]=false", acDialog
Case Else
MsgBox "Critères saisis incorrects !", vbCritical, "Vérifiez votre saisie."
End Select
End Sub |
Partager