AndreBourvil
Messages postés15Date d'inscriptiondimanche 27 juillet 2003StatutMembreDernière intervention 1 mars 2013
-
30 mars 2009 à 13:53
AndreBourvil
Messages postés15Date d'inscriptiondimanche 27 juillet 2003StatutMembreDernière intervention 1 mars 2013
-
30 mars 2009 à 20:57
Bonjour,
J'essaie de faire (en plus d'une recherche par nom) une liste multiple composée des nom et prénom du client ainsi que du numéro de facture comme ci-après: DUPONT Henri Facture N° 142
L'ajout, la suppression, la modification ainsi que la lecture se fait bien losrque ma liste est limitée à 1 seul champ (nom ou prénom par exemple) mais lors-ce-qu'elle est multiple, à l'initialisation (plus bas) les valeurs de tous mes champs concernant le client et la facture n'apparaissent pas (comme s'il y avait un problème d'indexation)
Par contre, ma liste affiche bien les champs demandés: liste_nom.AddItem Trim(VarEnreg.ChampNom) '& " " &
Trim(VarEnreg.ChampPrénom) & " " & "-" & " " & "Facture
N°" & " " & Trim(NumEnreg) (DUPONT Henri Facture N° 142)
Private Sub btn_ajouter_Click()
Dim p As Integer
Open App.Path & "\FACTURES.tba" For Random Access Read Write As #1 Len = Len(VarEnreg)
NumRows = LOF(1) \ Len(VarEnreg)
If txt_nom = "" Then
frm_aide.Show
frm_aide.lbl_aide_titre.Caption = "NOUVELLE FACTURE"
frm_aide.lbl_aide.Caption = "Vous devez renseigner le nom du client !"
Else
If txt_adresse = "" Then
frm_aide.Show
frm_aide.lbl_aide_titre.Caption = "NOUVELLE FACTURE"
frm_aide.lbl_aide.Caption = "Vous devez renseigner l'adresse du client !"
Else
If txt_ville = "" Then
frm_aide.Show
frm_aide.lbl_aide_titre.Caption = "NOUVELLE FACTURE"
frm_aide.lbl_aide.Caption = "Vous devez renseigner la ville du client !"
Else
If txt_code_postal = "" Then
frm_aide.Show
frm_aide.lbl_aide_titre.Caption = "NOUVELLE FACTURE"
frm_aide.lbl_aide.Caption = "Vous devez renseigner le code postal du client !"
Else
If txt_forme_juridique = "" Then
frm_aide.Show
frm_aide.lbl_aide_titre.Caption = "NOUVELLE FACTURE"
frm_aide.lbl_aide.Caption = "Vous devez renseigner la forme juridique du client !"
Else
For p = 0 To 16
VarEnreg.ChampMontant(p) = txt_montant(p)
VarEnreg.ChampQuantite(p) = txt_quantite(p)
VarEnreg.ChampPrixUnitaire(p) = txt_prix_unitaire(p)
VarEnreg.Champ_ProduitPrestation(p) = txt_poduit_prestation(p)
Next p
VarEnreg.ChampDate = lbl_date
VarEnreg.ChampTVA = txt_tva
VarEnreg.ChampMontantHT = txt_total_hors_taxe
VarEnreg.ChampTotalChampTVA = txt_total_tva
VarEnreg.ChampMontantTTC = txt_total_ttc
VarEnreg.ChampQte = lbl_quantite
VarEnreg.ChampPrix = p
VarEnreg.ChampMontantTHT = lbl_montant_hors_taxe
VarEnreg.ProduitPrestation = lbl_produit_prestation
'Put c'est pour ajouter les infos txt_nom, txt_prenom, ... dans le fichier #1
Put #1, NumRows + 1, VarEnreg