Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box Problem
Message
De
09/04/1997 14:52:37
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00026659
Message ID:
00027644
Vues:
54
>>>>>I am having a problem when I am entering data into a combo box. The data entered into the combo does not get entered into the underlying field unless the data is in the list. I have Style set to 0 - Dropdown Combo because I want the user to be able enter something that is NOT the list. Is there a property setting I am missing to do this?
>>>>
>>>>You should use something like this:
>>>>IF combo.displayvaluecombo.value
>>>>*** change source here, e.g.
>>>> INSERT into combosource VALUES()
>>>> combo.requery
>>>>ENDIF
>>>
>>>I do not want the value entered to go into the "combosource". The combosource (RowSource) is a select statement selecting data from another table. RowSourceType = 3. I want the user to be able enter something that is NOT the list and NOT be entered into the combosource...
>>>
>>>Yes, theoretically the new entry is not in the list and should be put into the other table, but what can I say...
>>
>>I think your situation assumes that you should use cursor alias as RowSource. Here, you can add 'value' to list without affecting tables.
>
>I want to use a select statement because I am merging the first name field with a last name field to build first column of the list: select alltrim(user.firstname) + ' ' + user.lastname, user.id from user.
>
>But this is not the major problem.
>
>It is supposed to be a _COMBINATION_ of the text box and the list box controls, but it is not. This is because I can place a text box control on the form *right next to* the combo box control with both controls having the same control source(alias.fieldname). Upon the screens initialization the text box will show the contents of the field but the combo box will not because the value in the field is not in the combo box's list...
>
>IMHO this is a bug. VFP tried to do much in one control.

No, it's right behaviour. If you want to see 'text portion' value inside 'list portion' you should explicitly 'add item' to RowSource. I guees you problem is invoked by ControlSource property. It's a good rule to clean it up.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform