Hi there,
I have a tablesum which normally works fine. However, every now and then it gives an error mess "Cannot use function in this context"
I attach the relevant code hoping that someone can spot why I am getting this message.
As I mention in the attachment var s_item is passed from a Form
I have a tablesum which normally works fine. However, every now and then it gives an error mess "Cannot use function in this context"
I attach the relevant code hoping that someone can spot why I am getting this message.
Code:
'Date Created: 05-Oct-2011 05:06:33 PM 'Last Updated: 05-Oct-2011 05:06:33 PM 'Created By : David 'Updated By : David ' ' The following s_ variables are session variables ' from the 'Define New variables' in a Form ' s_form_title = "Sop_Xct_Inv_prep_m" s_acc = "debt" s_acc_addr = "debt_addr" s_head = "sop_head_inv_prep" s_addr = "sop_addr_inv_prep" s_item = "sop_items_inv_prep" s_serve_head = "sop_head_inv" s_serve_addr = "sop_addr_inv" s_serve_item = "sop_items_inv" ' ' The Form has a OnSave event which call this script ' - part of which is coded here ' dim Td_head as p 'pointer to Sop Head dim Td_itm as p 'pointer to Sop Items dim Td_debt as p dim shared s_head as c 'Must load s_head file name in Form dim shared s_item as c 'Must load s_item file name in Form dim shared s_acc as c 'Must load s_acc file name in Form dim shared s_vat_rate as n 'Must load s_vat_rate file name in Form dim shared s_vat_code as n 'Must load s_vat_code file name in Form dim shared s_xact_id as n 'facilitates net and vat calc ' ' code in here has been removed as it is not relevant to the problem I have ' ' Note that Xm_xctidf which is part of the filter is the Id Field in Table Td_itm ' Td_itm.Xm_xctidf ' s_xact_id = Td_head.xf_xctidf 'needs to be shared or global ?? xact_filter = "Xm_xctidf = Var->s_xact_id" 'Works '######### Problem ? head_netamt = tablesum(s_item,xact_filter,"netamt") 'intermittent problem line ? '######### head_vatamt = tablesum(s_item,xact_filter,"Vatamt") s_net_amnt = head_netamt 'req for button 'btn_Commit_Xsact' s_vat_dsc_amnt = head_vatamt 'req for button 'btn_Commit_Xsact' '..Script 'debt_Job_Post_Btch_Ctrl' Td_head.change_begin() Td_head.Netamt = head_netamt Td_head.Acumitmvat = head_vatamt Td_head.Dueamt = head_netamt + head_vatamt Td_head.change_end() parentform.resynch()
Comment