Colonne dans listview limiter en caracteres

Résolu
cs_petchy Messages postés 710 Date d'inscription jeudi 20 février 2003 Statut Membre Dernière intervention 19 mai 2015 - 15 févr. 2009 à 22:03
cs_petchy Messages postés 710 Date d'inscription jeudi 20 février 2003 Statut Membre Dernière intervention 19 mai 2015 - 16 févr. 2009 à 09:57
bonsoir
dans une listview j'ai 4 colonnes
Désignation    Nbrs   taux/h  ttc
mais se qui est bizarre ,quand dans la colonne "Désignation" j'ai un texte de plus de 50 caracteres et quand je click sur cmd_sauv,rien ne se passe
par contre un texte de moins de 50 caractères,pas de probleme la facture est bien sauvegarder

voila le code du bouton :
Private Sub Cmd_sauv_Click()


On Error GoTo err
If Lbl_TotalTTC.Caption = "" Then
 MsgBox "Votre Facture est vide, création annulé", vbInformation + vbOKOnly, "TIPB"
 Exit Sub
End If
If lbl_ClientsEnCours.Caption = "Aucun Client de sélectionné" Then
 MsgBox "Il faut choisir un client avant de pouvoir crée la facture", vbInformation + vbOKOnly, "TIPB"
 Exit Sub
End If


Set rst = dbs.OpenRecordset("Select * from [T_Record] where [T_NumFacture]='" & Txt_NumFacture.Text & "'")
    rst.MoveLast
    rst.MoveFirst
If rst.RecordCount = 0 Then
Set recordset = dbs.OpenRecordset("T_Record", dbOpenDynaset)
        recordset.AddNew
        recordset![T_NumFacture] = Txt_NumFacture.Text
        recordset![T_RaisonSocial1] = "P"
        recordset![T_RaisonSocial2] = "L "
        recordset![T_Clients] = lbl_ClientsEnCours.Caption
        recordset![T_AdresseClients] = lbl_Adresse1ClientEnCours.Caption
        recordset![T_AdresseClients2] = lbl_Adresse2ClientEnCours.Caption
        recordset![T_RemisePersonne] = Lbl_MontantRemisepersonne.Caption          If Lbl_Perc_personne.Caption "" Then Lbl_Perc_personne.Caption " "
        recordset![T_PercRemisePersonne] = Lbl_Perc_personne
              If Lbl_MontantRemisematières.Caption = "" Then
          Lbl_MontantRemisematières.Caption = " "
        recordset![T_RemiseMatieres] = Lbl_MontantRemisematières.Caption            If Lbl_TTC_matieres.Caption "" Then Lbl_TTC_matieres.Caption " "
               recordset![T_PercRemiseMatieres] = Lbl_Perc_matières.Caption            If Lbl_TotalTTC.Caption "" Then Lbl_TotalTTC.Caption " "
        recordset![T_TotalTTC] = Lbl_TotalTTC.Caption & " €"
        recordset![T_TotalHT] = Lbl_TotalHT.Caption & " €"
        recordset![T_DontTVA] = Lbl_TotalTVA.Caption & " €"
        mois = UCase(Format(DTPicker1.Value, "MMMM"))
        recordset![T_DateCreation] = Format(DTPicker1.Value, "DD") & " " & mois & " " & DTPicker1.Year
        recordset![T_HeureCreation] = Time
        recordset![T_AnneeIndex] = DTPicker1.Year
        recordset![T_TVA] = TVA_Courante
        recordset.Update
       
Set recordset = dbs.OpenRecordset("T_Facture_personne", dbOpenDynaset)
For a = 1 To ListView1.ListItems.Count
'PrixPersonne = Val(PrixPersonne) + Val(ListView1.ListItems(a).SubItems(6))


        recordset.AddNew
        recordset![T_NumFacture] = Txt_NumFacture.Text
        recordset![T_Produit] = ListView1.ListItems(a)
        recordset![T_Quantite] = ListView1.ListItems(a).SubItems(1)
        recordset![T_Prix] = ListView1.ListItems(a).SubItems(2)        
        recordset![T_TVA] = ListView1.ListItems(a).SubItems(3)
        recordset![T_PrixTTC] = ListView1.ListItems(a).SubItems(4) '& " €"
        recordset![T_TotalHT] = ListView1.ListItems(a).SubItems(5) '& " €"
        recordset![T_TotalTTC] = ListView1.ListItems(a).SubItems(6) '& " €"
        recordset![T_AnneeIndex] = DTPicker1.Year
        recordset.Update
Next a




Set recordset = dbs.OpenRecordset("T_Facture_matières", dbOpenDynaset)
For a = 1 To ListView2.ListItems.Count
'PrixPersonne = Val(PrixPersonne) + Val(ListView1.ListItems(a).SubItems(6))


        recordset.AddNew
        recordset![T_NumFacture] = Txt_NumFacture.Text
        recordset![T_Produit] = ListView2.ListItems(a)
        recordset![T_Quantite] = ListView2.ListItems(a).SubItems(1)
        recordset![T_Prix] = ListView2.ListItems(a).SubItems(2) '& " €"
        recordset![T_TVA] = ListView2.ListItems(a).SubItems(3)
        recordset![T_PrixTTC] = ListView2.ListItems(a).SubItems(4) ' & " €"
        recordset![T_TotalHT] = ListView2.ListItems(a).SubItems(5) '& " €"
        recordset![T_TotalTTC] = ListView2.ListItems(a).SubItems(6) '& " €"
        recordset![T_AnneeIndex] = DTPicker1.Year
        recordset.Update
Next a
Else
ModifFacture
'MsgBox "Cette facture existe déja", vbInformation + vbOKOnly, "TIPB"
Exit Sub


End If
Cmd_sauv.Enabled = False
MsgBox "Création correctement effectué", vbInformation + vbOKOnly, "TIPB"
Exit Sub


err:
If err.Number = 3021 Then Resume Next
End Sub
il y a t'il un nombre maximun de caracteres 
en tous cas c'est bizarre,,auriez vous une idée
merci
petchy

2 réponses

Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
16 févr. 2009 à 08:56
vire deja (bouton droit > basculer > arret sur toutes les erreurs)

le gestion d'erreurs.
ca te masque ton erreur, j'en suis sur (champs dans ta base trop court ?)
3
cs_petchy Messages postés 710 Date d'inscription jeudi 20 février 2003 Statut Membre Dernière intervention 19 mai 2015 4
16 févr. 2009 à 09:57
bonjour
merci Renfield pour ta réponse,en effet cela vient de ma base,
taille du champ trop court
merci à toi
bonne journée
0
Rejoignez-nous