Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to control WHEN a grid updates?
Message
De
13/04/2000 21:49:08
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00350331
Message ID:
00359617
Vues:
13
Barbara...

Ya know, sometimes I just hate programming!!!! Here you pointed out another, wonderful, command (oldval) that
I didn't even know existed and I fought a problem programatically awhile ago for a similar need. Geez.

I'll give the OldVal routine a whirl and see if that works. Seems easier.





>Hi Peter,
>One problem is that GetFldState() only returns values 1,2,3 and 4. So your code won't fire. You want to check for '2' (updated existing record), '3' (new record) and '4' (updated new record).
>
>Unfortunately BeforeRowColChange() fires BEFORE the Valid() for the grid textbox, and GetFldState() is updated in the Valid.
>
>Instead, try checking the value of the textbox against the Oldval(). In the grid textbox valid() you can put:
>If !oldval(myfield)  = this.value
>   TableUpdate()
>endif
>
>GetFldState() will work in the AfterRowColChange(), but by then you might have already left any row that was updated.
>
>HTH
>Barbara
>
>>Hi Barbara....
>>
>>I am having a bit of a problem with the GETFLDSTATE you recommended.
>>
>>Here is my code in the BEFOREROWCOLCHANGE for my GRID...
>>
>>
>>if GetFldState("qtystart")=0 or GetFldState("qtyend")=0
>> tableupdate(.T.)
>>endif
>>
>>
>>The grid is set for vEventBar as the view name and the fields that take changes are QTYSTART and
>>QTYEND.
>>
>>When I make changes to the data in either column of the grid, this never seems to fire for when I change the
>>view or exit, I get an error about the buffer for vEventBar. I did some more checking, and the GetFldState never
>>changes from a 1 UNTIL I exit the grid, then I get a 2. I placed a MESSAGEBOX before the GETFLDSTATE to
>>make sure this was firing, and it is after every row or col change. Am I missing something?
>>
>>Thanks
>>
>>
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform