Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Value_Assign triggers Redundant Write to Table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00619831
Message ID:
00619962
Views:
11
>Hi
>
>In the Value_Assign method of a data bound control the line:
>
>
>This.Value=eNewVal
>
>
>triggers a write to the table which makes sense when you change the value. However when bound to a table field, it also triggers a write to the table when the control is refreshed with new data from a table. So you have the odd situation where the control is refreshing itself with new data from a table and that triggers a redundant write back to the table even though no data has been changed.
>
>Lets assume we have a grid and a combobox on a form. The combobox is bound to a field in the same table that the grid is bound to. Let's assume for some reason that the combobox has a Value_Assign method. Every time you move to a new record in the grid and refresh the combobox the Value_Assign triggers a write back to the table.
>
>Is this the designed behaviour? It would have been nice if the Value_Assign was still accessed in the above secnario but the redundant write back to the file did not occur. In my opinion for what ever it is worth is that the write back to the table should occur everytime the value is changed but not when the value is just being read from the table.
>
>Simon White

There were several threads in the past discussing Value_Assign not firing.

For example:

Value_assign not working with checkbox control Thread #464448 Message #465838
Classes - VCX ASSIGN method Thread #267357 Message #267357
Coding, syntax & commands VFP6 goofy behavior or goofy developer -- you decide Thread #209816 Message #209816, Message #209832
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform