Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Y2KO'ed by Comboboxes!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00313319
Message ID:
00313936
Vues:
42
Steve,

First off, Use event tracking to get a sequence of events that's occurring, it'll help you track down the why. This can be your best friend when trying to determine what is happening in a complex event sequence.

Is your Save button on a toolbar? If so the last control you are in isn't losing focus which is the event that causes Valid to be triggered.

Typically in a toolbar button it's click code has to do something like:
if ( IsObject( _screen.ActiveForm.ActiveControl ) )
   _screen.ActiveForm.ActiveControl.SetFocus()
endif
This sets focus to the current control, but first it triggers the Valid and LostFocus because it doesn't realize that control already has focus.

Is there a reason you aren't binding the cbo directly to the field?

You might need to do the replace in the InteractiveChange event instead.

>I think you might be right about that. What would make the Valid() not fire? I think I will take Erik Moore's suggestion and strip the form of all code except those relevant controls and see if I can eliminate the cause. When I press the Save button to do the TABLEUPDATE those bottom 3 comboboxes act as if I pressed the Cancel button and did a TABLEREVERT.
>
>Here is a sequence of events:
>1. Chose values from all 4 comboboxes without problem
>2. Pressed Save, but only #1 combobox saves, last 3 comboboxes reset to prior settings
>3. Pressed Edit and re-chose values from last 3 comboboxes without problem
>4. Pressed Save, but only #2 combobox saves, last 2 comboboxes reset to prior settings
>5. Pressed Edit and re-chose values from last 2 comboboxes without problem
>6. Pressed Save, but only #3 combobox saves, last comboboxes reset to prior setting
>7. Pressed Edit and re-chose value from last combobox without problem
>8. Pressed Save and #4 combobox saves
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform