Longeur de string dans une ComboBox

chaloboa Messages postés 3 Date d'inscription mardi 18 février 2003 Statut Membre Dernière intervention 25 janvier 2005 - 25 janv. 2005 à 12:02
chaloboa Messages postés 3 Date d'inscription mardi 18 février 2003 Statut Membre Dernière intervention 25 janvier 2005 - 25 janv. 2005 à 18:08
Bonjour,

Voila, j'ai une question simple :
Est-il normale d'être limité à 80 charactères dans la longeur d'une string récupérée dans une combobox, et si non comment peut-on y remédier?

Merci d'avance.

4 réponses

cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 9
25 janv. 2005 à 13:42
Il ni a pas de Limites à 80 caractéres dan sune combobox..

Comment tu ajoutes et recupéres les infos ??

It@li@
0
chaloboa Messages postés 3 Date d'inscription mardi 18 février 2003 Statut Membre Dernière intervention 25 janvier 2005
25 janv. 2005 à 14:09
Salut et merci pour la réponse...

Je récupere mes données dans une base access avec une requete qui retourne les différents champs dans un DAO.recordset. Le dernier des champs est dans la base un champ TEXT et si jamais il dépasse les 80 CHAR je peut le voir mais pas le sélectionner.
0
cs_ITALIA Messages postés 2169 Date d'inscription vendredi 20 avril 2001 Statut Membre Dernière intervention 30 juin 2009 9
25 janv. 2005 à 14:30
C'est du VB ou du VBA ?
C'est une Base ACCESS ??
Regardes si le type du champ n'est pas limtés à 80 ! ( dans la Base

Donnes aussi ton code.

It@li@
0
chaloboa Messages postés 3 Date d'inscription mardi 18 février 2003 Statut Membre Dernière intervention 25 janvier 2005
25 janv. 2005 à 18:08
C'est du VBA
-faut m'excuser, ça fait trop longtemps que j'ai pas mis le nez dans du code-
Base ACCESS 2000
le champ est limité à 255 CHAR dans la base.
Sinon, je suppose que tu veux le code de la récupération des données. Le voila :
___________________________________________________________________
Public Sub Check()


Dim dblNumeroPlan As Double
Dim strQuery As String
Dim db As DAO.Database
Dim rstPlan As DAO.recordset


strQuery = "SELECT "
strQuery = strQuery & "[Numéro de ligne] "
strQuery = strQuery & "FROM T_PLAN "
strQuery = strQuery & "WHERE "

Form_F_bilan_ligne.Département.SetFocus strQuery strQuery & "Département'" & Form_F_bilan_ligne.Département.Text & "' AND "

Form_F_bilan_ligne.Secteur.SetFocus
strQuery = strQuery & "Secteur='" & Form_F_bilan_ligne.Secteur.Text & "' AND "

Form_F_bilan_ligne.Localisation.SetFocus
strQuery = strQuery & "Localisation='" & Form_F_bilan_ligne.Localisation.Text & "' AND "

Form_F_bilan_ligne.LibelleI.SetFocus
strQuery = strQuery & "Libellé='" & Form_F_bilan_ligne.LibelleI.Text & "'AND "

Form_F_bilan_ligne.Année.SetFocus
strQuery = strQuery & "Année=" & Form_F_bilan_ligne.Année.Text & ";"


Set db = CurrentDb
Set rstPlan = db.OpenRecordset(strQuery)

dblNumeroPlan = rstPlan.Fields![Numéro de ligne]

strQuery = "SELECT "
strQuery = strQuery & "[Numéro de ligne], "
strQuery = strQuery & "Département, "
strQuery = strQuery & "Secteur, "
strQuery = strQuery & "Localisation, "
strQuery = strQuery & "Libellé , "
strQuery = strQuery & "Année "
strQuery = strQuery & "FROM T_Détails_dossier "
strQuery = strQuery & "WHERE [Numéro de ligne]=" & dblNumeroPlan & ";"

Set rstPlan = db.OpenRecordset(strQuery)

rstPlan.MoveLast
rstPlan.MoveFirst

Dim intLigne As Integer

For intLigne = 1 To rstPlan.RecordCount

' DEPARTEMENT

Form_F_bilan_ligne.Département.SetFocus
If Form_F_bilan_ligne.Département.Text <> rstPlan.Fields![Département] Then
Form_F_bilan_ligne.txtDepWarning.Visible = True
Form_F_bilan_ligne.txtDepWarning.BackColor = vbRed
Form_F_bilan_ligne.txtDepWarning.ControlTipText = rstPlan.Fields![Département]
Form_F_bilan_ligne.txtDepWarning.SetFocus
Form_F_bilan_ligne.txtDepWarning = Form_F_bilan_ligne.txtDepWarning + 1
End If

' SECTEUR

Form_F_bilan_ligne.Secteur.SetFocus
If Form_F_bilan_ligne.Secteur.Text <> rstPlan.Fields![Secteur] Then
Form_F_bilan_ligne.txtSecWarning.Visible = True
Form_F_bilan_ligne.txtSecWarning.BackColor = vbRed
Form_F_bilan_ligne.txtSecWarning.ControlTipText = rstPlan.Fields![Secteur]
Form_F_bilan_ligne.txtSecWarning.SetFocus
Form_F_bilan_ligne.txtLocWarning = Form_F_bilan_ligne.txtLocWarning + 1
End If

' LOCALISATION

Form_F_bilan_ligne.Localisation.SetFocus
If Form_F_bilan_ligne.Localisation.Text <> rstPlan.Fields![Localisation] Then
Form_F_bilan_ligne.txtLocWarning.Visible = True
Form_F_bilan_ligne.txtLocWarning.BackColor = vbRed
Form_F_bilan_ligne.txtLocWarning.ControlTipText = rstPlan.Fields![Localisation]
Form_F_bilan_ligne.txtLocWarning.SetFocus
Form_F_bilan_ligne.txtSecWarning = Form_F_bilan_ligne.txtSecWarning + 1
End If

' LIBELLE

Form_F_bilan_ligne.LibelleI.SetFocus
If Form_F_bilan_ligne.LibelleI.Text <> rstPlan.Fields![Libellé] Then
Form_F_bilan_ligne.txtLibWarning.Visible = True
Form_F_bilan_ligne.txtLibWarning.BackColor = vbRed
Form_F_bilan_ligne.txtLibWarning.ControlTipText = rstPlan.Fields![Libellé]
Form_F_bilan_ligne.txtLibWarning = Form_F_bilan_ligne.txtLibWarning + 1
End If

rstPlan.MoveNext

Next intLigne

Set rstPlan = Nothing
db.Close


End Sub
0
Rejoignez-nous