So how exactly is that structured?
Code:
////////////////////////////////////////////////////////////////
// Event delegate for 'changed' event
function Scrap_Bins_Used_section3_field12_changed()
{
// insert your code here
var BinFound = keylookup("ScrapBinWeights","BINNUMBER",Lianja.get("Scrap_Bins_Used.section3.field12").value,"?BinTareWeight","0");
if (BinFound == 0){
messageBox("Bad Bin # -- try again.");
} else {
Lianja.get("Scrap_Bins_Used.section3.BinTareWeight").value = BinFound;
Lianja.getCursor('scrapweights') ;
}
}
I'm used to VFP Thisform.field1.value = myvalue. and thats all there is to it
Whats the syntax for doing what you recommend?

Originally Posted by
HankFay
Hi Jon,
In 5.2, the action of saving a new value to a field in a table used as a controlsource involves getting the section cursor, using the section's getCursor() method. The data then gets moved to the cursor using the cursor object's setData() method. The data then gets saved to the backend using the Update method of the cursor object. A call to the section's Refresh method will then get the data from the backend data and show the change in the section. Note that for testing purposes, the code you have will display the change you made, which can be handy for initial testing. If you were going beyond that to actually save the data, you would follow the steps listed above, substituting them for that one line of code.
It's easy enough to write a function (in JavaScript or VFP) to handle of all of what you thought should work. It would need to have passed a) the section path (page.section), b) the control id, and c) the new value for that control.
That said, I've heard a rumor from an ordinarily good source

that changes in 5.3 will make writing that function unnecessary, or at least much simpler. Stay tuned.
Hank
Bookmarks