![]() |
Alexey admin 11/9/2006 |
Han, Function BeforeEdit(dict, where) ' Parameters: ' dict - Scripting.Dictionary object. ' Each field on the Edit form represented as 'Field name'-'Field value' pair ' where - string with WHERE clause pointing to record to be edited '** Custom code **** max_kaarten = 10 // maximaal aantal te bestellen kaarten dict("TotaalPunten") = dict("dec26") + dict("dec27") +dict("dec28") dict("TotaalPunten") = dict("TotaalPunten") + dict(dec29") 2 dict("TotaalPunten") = dict("TotaalPunten") + dict("dec30") 3 ' ' put your custom code here If dict("TotaalPunten") < max_kaarten then BeforeEdit = True else BeforeEdit = False message "<div class=message><<< Maximum of 10 is reached >>></div>" end if ' set BeforeEdit to True if you like to proceed with editing this record ' set it to False in other case End Function |
|
hanb author 11/9/2006 |
Alexey, |
|
hanb author 11/9/2006 |
Small correction, I do see the totaal_punten field updated after placing the underscore, my mistake. Alexey, I have changed the code yo get all my fileds included and now I get the edit page on my screen, however I still do not see anything happening in the total, or in checking the data, no error messages. I suppose the before edit kicks in when i hit the save button, so it should change at least the TotaalPunten field. But that still is zero. Han Function BeforeEdit(dict, where) ' Parameters: ' dict - Scripting.Dictionary object. ' Each field on the Edit form represented as 'Field name'-'Field value' pair ' where - string with WHERE clause pointing to record to be edited '** Custom code **** max_kaarten = 10 // maximaal aantal te bestellen kaarten free_kaarten = 4 dict("TotaalPunten") = dict("dec23") + dict("dec24") + dict("dec26") + dict("dec27") +dict("dec28") dict("TotaalPunten") = dict("TotaalPunten") + dict("dec29") 2 dict("TotaalPunten") = dict("TotaalPunten") + dict("dec30") 3 ' ' put your custom code here If dict("TotaalPunten") <= max_kaarten then BeforeEdit = True else BeforeEdit = False message "<div class=message><<< Maximum of 10 is reached >>></div>" end if If dict("dec22") > free_kaarten then BeforeEdit = False message "<div class=message><< Maximum van 4 kaarten voor 22 december bereikt>>></div>" else BeforeEdit = True end if If dict("dec26") > free_kaarten then BeforeEdit = False message "<div class=message><< Maximum van 4 kaarten voor 26 december bereikt>>></div>" else BeforeEdit = True end if ' set BeforeEdit to True if you like to proceed with editing this record ' set it to False in other case End Function |
![]() |
Alexey admin 11/9/2006 |
Han, message = "<div ..."
message "<div ..." |