Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to control WHEN a grid updates?
Message
 
To
12/04/2000 22:48:39
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00350331
Message ID:
00359611
Views:
15
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
>
>
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform