大家会不会把数据库操作写成一个模块,然后在要对数据库操作的各处调用
就像下列的单个对数据库进行更新的代理.有没有好办法让其模块化
SQLA = "SELECT * from unvodeta WHERE VoNum='" & Trim([Forms]![Acc_unpostedvoucher]![v_vouchernum]) & "'"
Set RSA = CurrentDb.OpenRecordset(SQLA)
SQLB = "select * from tem_unvodeta"
Set RSB = CurrentDb.OpenRecordset(SQLB)
While Not RSA.EOF
RSB.AddNew
RSB("vonum") = RSA("vonum")
RSB("linenum") = RSA("linenum")
RSB("partmemo") = RSA("partmemo")
RSB("apcurrency") = RSA("apcurrency")
RSB("rate") = RSA("rate")
RSB("jobnum") = RSA("jobnum")
RSB("jobnum2") = RSA("jobnum2")
RSB("jobnum3") = RSA("jobnum3")
RSB("jobnum4") = RSA("jobnum4")
RSB("chqnum") = RSA("chqnum")
RSB("oldcompcode") = RSA("oldcompcode")
RSB("cocode") = RSA("cocode")
RSB("invnum") = RSA("invnum")
RSB("lastmodifiedtime") = Now
RSB.Update
RSA.MoveNext
Wend
RSA.Close
RSB.Close
有没有高手愿意给一些模块化的方案(针对access开发).我想大家都乐意听听
有没有高手愿意给一些针对VBA模块设计的概念?偶的模块化真的很穷
[此贴子已经被作者于2007-1-25 15:58:59编辑过]
|