Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combobox nightmares
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Combobox nightmares
Divers
Thread ID:
00310817
Message ID:
00310817
Vues:
67
HELLLLLLLLLP!

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.
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform