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
|
Private Sub Init_List()
Dim Strsql As String
Dim CodeAts As String
Me.ListView1.ListItems.Clear
Set Db = CurrentDb
CodeAts = NumCodeAts
DoCmd.Maximize
Me.ListView1.View = lvwReport
Strsql = "SELECT Article.NumOrdre, NumCodeAts, NbreEnStock, NumEntree, Raison,EntreeStock, Depot, Nom, Date FROM Article, Entree WHERE Article.NumOrdre = Entree.NumOrdre And NumCodeAts = '" & CodeAts & "';"
Set Rs = Db.OpenRecordset(Strsql)
Rs.MoveFirst
While Not Rs.EOF
Set LaLigne = LaListe.ListItems.Add()
LaLigne.Text = Rs!NumEntree
LaLigne.SubItems(1) = Nz(Rs!NumOrdre, "None")
LaLigne.SubItems(2) = Nz(Rs!NumCodeAts, "None")
LaLigne.SubItems(3) = Nz(Rs!Raison, "None")
LaLigne.SubItems(4) = Nz(Rs!EntreeStock, "None")
LaLigne.SubItems(5) = Nz(Rs!Depot, "None")
LaLigne.SubItems(6) = Nz(Rs!Nom, "None")
LaLigne.SubItems(7) = Nz(Rs!NbreEnStock, "None")
LaLigne.SubItems(8) = Nz(Rs!Date, "None")
Rs.MoveNext
Wend
Rs.Close
ListView1.SortKey = 0
ListView1.SortOrder = lvwAscending
ListView1.Sorted = True
ListView1.SelectedItem.EnsureVisible
End Sub |
Partager