Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox nightmares
Message
De
31/12/1999 01:26:50
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00310817
Message ID:
00310829
Vues:
25
Steve-

Do I understand correctly? Your list displays a description in column1, but when the user types in a value (that's not in the list), they are directly typing in the ID (column2 field)?

That is a bit of a problematic twist. How do you know they aren't typing in a description? After all, that's what's being displayed?

IAC, it's not being saved because the control is bound to the field. So, yes you'd need to handle this manually.

Or, if it makes sense to do this, when I've had interfaces where the user's might select one or another of two fields, I've given them two combos. They can choose whichever one is appropriate. Then, when I just have to keep them coordinated.

IMO, it's is better to not use one control to enter two different datum.

>I have a drop-down combobox and I can't get it to do what I want. Hummmmmpf! I read and studied all of my combobox books and samples and tried numerous variations and tests without success. This can't be this hard. Can it?
>
>I have a combobox RowSource = MyTable.MyDesc,MyID
>I have BoundTo = .T.
>I have BoundColumn = 2
>I have ControlSource = MyOtherTable.MyID
>
>The problem I am having is when the user enters a value that is not in the list. I don't want to add the entered value to the list. I want to save the entered value in MyOtherTable.MyID. But of course, MyOtherTable.MyID is Char 4 so even though the user is not entering a valid ID as is found in MyTable.MyID, the value will still fit in the Char 4 field called MyOtherTable.MyID. However, the value the user enters manually never gets saved.
>
>The only way I can get the value to save is by making ControlSource = None and adding code to the Valid Event and the Refresh Event for THIS.DisplayValue. Then it saves the user entered value in MyOtherTable. But then, I can't get the drop-down list to behave properly and save properly.
>
>I even tried comparing the THIS.DisplayValue and THIS.Value in the Valid event to fake it out, but that didn't fix it as I had hoped.
>
>In other words, I can't have my cake and eat it too. I want it both ways. There must be a way. I am going in circles. Not a good sign. Please help me solve this mystery. Thanks so much. It will be a Happy New Year if I ever get this thing working.
>
>Happy New Year ahead of time! Thanks for helping me maintain my sanity. It can't be all that hard. Can it?
>
>p.s. - I think I will write on book on comboboxes before this is all said and done. None of the books I have read including MS VFP 6.0 Programmer's Guide explain this one very well.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform