凭证录入表的摘要列,在项目属性AFTEROPENJECT中被设置成下拉式窗口列,Tables("凭证录入表").Cols("摘要").DropForm ="凭证录入辅助摘要下拉窗口"在该表DATACOLCHANGED 属性中有如下代码:
If e.DataCol.name = "借方金额" Then
Dim s As Double = e.DataTable.Compute("sum(借方金额)")
Forms("凭证录入").Controls("Lab借方合计").text = format(s,"###,###,###,##0.00")
If e.NewValue <> 0 Then
e.DataRow("贷方金额") = 0
Dim c1 As String = e.DataRow("摘要") '找出当前行摘要
Tables("凭证录入表").Position = Tables("凭证录入表").Position+1
Tables("凭证录入表").Select(Tables("凭证录入表").rowsel,Tables("凭证录入表").Cols("摘要").Index)
e.DataRow("摘要") = c1
’ Forms("凭证录入辅助摘要下拉窗口").DropDownBox.Value = c1 'Exception has been thrown by the target of an invocation.
End If
End If
其中 第9行 e.DataRow("摘要") = c1 '该行想将上行摘要移入下行,但该行还是显示空白
用 Forms("凭证录入辅助摘要下拉窗口").DropDownBox.Value = c1 ‘用该行代码替代出现Exception has been thrown by the target of an invocation.错误信息
请教如何编制代码?