Set rst = dbs.OpenRecordset("Select * from [T_Record] where [T_NumFacture]='" & ListView1.SelectedItem.Text & "'") rst.MoveLast rst.MoveFirst For a = 0 To rst.RecordCount - 1 rst.Edit rst.Delete rst.MoveNext Next a
If Not Nothing Is ListView1.SelectedItem Then dbs.Execute "DELETE FROM [T_Record] WHERE [T_NumFacture]='" & Replace(ListView1.SelectedItem.Text, "'", "''") & "'" End If
Private Sub IniFillListView()ListView1.ListItems.Clear If chk_année.Value = 1 Then Set rst = dbs.OpenRecordset("Select * from [T_Record]") Else Set rst = dbs.OpenRecordset("Select * from [T_Record] where [T_AnneeIndex]='" & Lst_ClassementAnnee.Text & "' And [T_DateCreation]like '*" & Lst_Mois.Text & "*'") End If rst.MoveLast rst.MoveFirst lbl_NumFacture.Caption = rst.Fields(0) Lbl_NomClient.Caption = rst.Fields(3) Lbl_DateFacture.Caption = rst.Fields(18) lbl_TotalFacture.Caption rst.Fields(16) Label3.Caption rst.Fields(4) For a = 0 To rst.RecordCount - 1 Set itmX = ListView1.ListItems.add(, , rst.Fields(0)) itmX.Bold = True itmX.ForeColor = &HFF0000 itmX.SubItems(1) = rst.Fields(3) itmX.SubItems(2) = rst.Fields(18) itmX.SubItems(3) = rst.Fields(16) rst.MoveNext Next a Set rst = dbs.OpenRecordset("Select * from [T_Facture_personne] where [T_NumFacture]='" & ListView1.SelectedItem.Text & "'") rst.MoveLast rst.MoveFirst nbproduit = 0 prixttc = 0 For a = 0 To rst.RecordCount - 1 nbproduit = nbproduit + 1 prixttc = val(prixttc) + val(rst.Fields(4)) Next a lbl_personne.Caption = nbproduit & " Produit(s) pour " & prixttc & " €" Me.Caption = ListView1.ListItems.Count & " Fiches" End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question