按钮代码改为
Dim max As Integer = Tables("明细账表").compute("max(凭证_明细号)")
Dim r As Row
If Tables("明细账表").Current Is Nothing
r = Tables("明细账表").addnew
Else
r = Tables("明细账表").Current.Clone()
End If
r("凭证_明细号") = max + 1
r("明细账_售出金额") = Nothing
r("明细账_废piao") = Nothing
r("姓名") = Nothing
r("领入日期") = Nothing
r("明细账_售出张数") = Nothing
r("明细账_结存张数") = Nothing
r("明细账_售出起号") = Nothing
r("明细账_上年结转张数") = Nothing
r("明细账_退piao张数") = Nothing
r("明细账_今日领入张数") = Nothing
r("明细账_领入起号") = Nothing
r("明细账_领入止号") = Nothing
r("明细账_售出止号") = Nothing
r("摘要_日期") = Nothing
r("明细账_领入张数") = Nothing