jeudi 17 décembre 2015

Access Vba Setorderby ASC or DESC with and if

In a form in ACCESS, i want the user to be able to set by ASC and DESC by clicking the same button. My code only sorts by ASC

Public Function Tri_par_vehicule()

  If OrderBy = "Véhicules ASC" Then
    DoCmd.SetOrderBy "Véhicules DESC"
  Else
    DoCmd.SetOrderBy "Véhicules ASC"
  End If
End Function  

Aucun commentaire:

Enregistrer un commentaire