本文介绍了调用方法时如何传递maltiple参数。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有更新方法 公共 Sub 更新( ByVal cFields As 对象, ByVal 值作为 对象) 如果 RsVoucher.Rows.Count = 0 然后 RsVoucher.AddNew() 对于 Counter = LBound(cFields)到 UBound(cFields) RsVoucher.Fields(cFields(Counter))=值(计数器) 下一步 如果 CNull(RsVoucher.Rows( 0 )( DocNo), )= 然后 RsVoucher.Rows( 0 )( DocNo)= NextVoucherNo(RsVoucher.Rows( 0 )( TransTypeID),RsVoucher.Rows( 日期)) 如果 CNull(RsVoucher.Rows( 0 )( UserID), )= 然后 RsVoucher.Rows( 0 )( UserID)= CurrentUser.UserID ' 如果是CNull(RsVoucher! PaymentDesc)=然后RsVoucher!PaymentDesc = RsVoucher.Update() 结束 Sub 当我调用此方法我想传递参数,例如 更新((CID,StudentID,Dated,TransTypeID ,叙述,金额),(0,Ado_Student.Recordset!StudentID,Txt_Dated.Text,S2KVoucherType.Fee_Receipt,txt_Remark.Text,txt_Amount.Text)) 我该怎么做。解决方案 i have a update methodPublic Sub Update(ByVal cFields As Object, ByVal Values As Object) If RsVoucher.Rows.Count = 0 Then RsVoucher.AddNew() For Counter = LBound(cFields) To UBound(cFields) RsVoucher.Fields(cFields(Counter)) = Values(Counter) Next If CNull(RsVoucher.Rows(0)("DocNo"), "") = "" Then RsVoucher.Rows(0)("DocNo") = NextVoucherNo(RsVoucher.Rows(0)("TransTypeID"), RsVoucher.Rows("Dated")) If CNull(RsVoucher.Rows(0)("UserID"), "") = "" Then RsVoucher.Rows(0)("UserID") = CurrentUser.UserID 'If CNull(RsVoucher!PaymentDesc) = "" Then RsVoucher!PaymentDesc = "" RsVoucher.Update() End Subwhen i call this method i want to pass parameters likeUpdate(("CID", "StudentID", "Dated", "TransTypeID", "Narration", "Amount"),(0, Ado_Student.Recordset!StudentID, Txt_Dated.Text, S2KVoucherType.Fee_Receipt, txt_Remark.Text, txt_Amount.Text))how can i do it. 解决方案 这篇关于调用方法时如何传递maltiple参数。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-20 11:34