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
| Private Sub Commande45_Click()
Dim SQL As String
SQL = "SELECT total_entreprise.NUMERO_APPEL, total_entreprise.Raison," & _
"total_entreprise.Adresse, total_entreprise.[Code postal], total_entreprise.Ville," & _
"total_entreprise.Département, total_entreprise.CST, total_entreprise.Effectifs," & _
"total_entreprise.[Masse salariale], total_entreprise.[Type de dossier]," & _
"total_entreprise.[Versement total], total_entreprise.FNDMA, total_entreprise.[Taxe CDA]," & _
"total_entreprise.[Affecté A], total_entreprise.[Affecté B], total_entreprise.[Affecté C]," & _
"total_entreprise.[Affecté quota obligatoire], total_entreprise.[Affecté quota]," & _
"total_entreprise.[Libre A], total_entreprise.[Libre AB], total_entreprise.[Libre B]," & _
"total_entreprise.[Libre BC], total_entreprise.[Libre C]," & _
"total_entreprise.[Libre Non Soumis], total_entreprise.[Libre Quota]" & _
"FROM total_entreprise WHERE total_entreprise.Effectifs <> 0 "
If Me.coche_effect = True Then
SQL = SQL & "AND total_entreprise.Effectifs BETWEEN " & Me.Effect_entre & " AND " & Me.effect_et
End If
If Me.coche_masse = True Then
SQL = SQL & "AND total_entreprise.[Masse salariale] BETWEEN " & Me.masse_entre & "AND " & Me.masse_et
End If
If Me.coch_cst = True Then
SQL = SQL & "AND total_entreprise.CST ='" & Me.list_cst & "'"
End If
If Me.coch_cp = True Then
SQL = SQL & "AND total_entreprise.[Code postal] ='" & Me.list_cp & "'"
End If
If Me.coch_dept = True Then
SQL = SQL & "AND total_entreprise.Département ='" & Me.list_dept & "'"
End If
SQL = SQL & " ;"
DoCmd.RunSQL SQL
End Sub |
Partager