|
8#
楼主 |
发表于 2007-9-11 22:33:39
|
只看该作者
VB中相关代码如下
Private Sub cmdPrintAll_Click()
ProgressBar1.Visible = True
ProgressBar1.Max = lstBarcode.ListCount
For I = 1 To lstBarcode.ListCount
ProgressBar1.Value = I
Label6.Caption = "第 " & lstBarcode.ListIndex + 1 & " 条/共 " & lstBarcode.ListCount & " 条"
lstBarcode.ListIndex = I - 1
If GetCustomerInfo(lstBarcode.Text) = True Then
conn.Execute "DELETE * FROM tblJobPRT"
conn.Execute "DELETE * FROM tblAccPRT"
conn.Execute "INSERT INTO tblJobPRT ( 单位账号, 序号, 所号, 条形码, 单位名称, 存款类型, 账户余额, 累计借方发生额, 累计贷方发生额, 机构名称, 机构地址, 岗位, 姓名, 办公电话, 客户地址, 邮政编码, 联系电话, 联系人, 对帐截止日期, HavePage ) " & _
"SELECT tblJobList.单位账号, tblJobList.序号, tblJobList.所号, tblJobList.条形码, tblJobList.单位名称, tblJobList.存款类型, tblJobList.账户余额, tblJobList.累计借方发生额, tblJobList.累计贷方发生额, tblJobList.机构名称, tblJobList.机构地址, tblJobList.岗位, tblJobList.姓名, tblJobList.办公电话, tblJobList.客户地址, tblJobList.邮政编码, tblJobList.联系电话, tblJobList.联系人, tblJobList.对帐截止日期, tblJobList.HavePage " & _
"From tblJobList " & _
"WHERE tblJobList.单位账号 = '" & txtAccount.Text & "'"
printCus
If HaveAtt = True Then
conn.Execute "INSERT INTO tblAccPRT ( NSN,所号, 一级支行, 二级支行, 科目号, 账号, 单位名称, 日期, 摘要, 凭证号, 对方科目, 借贷标志, 借发生额, 贷发生额, 借或贷, 余额, 复合员 ) " & _
"SELECT tblAccount.NSN, tblAccount.所号, tblAccount.一级支行, tblAccount.二级支行, tblAccount.科目号, tblAccount.账号, tblAccount.单位名称, tblAccount.日期, tblAccount.摘要, tblAccount.凭证号, tblAccount.对方科目, tblAccount.借贷标志, tblAccount.借发生额, tblAccount.贷发生额, tblAccount.借或贷, tblAccount.余额, tblAccount.复合员 " & _
"From tblAccount " & _
"WHERE tblAccount.账号 = '" & txtAccount.Text & "' ORDER BY NSN"
printAcc
End If
End If
If Check1.Value = 1 Then
If I = 10 Then Exit For
End If
Next
End Sub
Sub printCus()
Dim MSAccess As New Access.Application
MSAccess.OpenCurrentDatabase App.Path & "\whcbank.mdb"
MSAccess.DoCmd.OpenReport "new", acViewNormal
MSAccess.CloseCurrentDatabase
MSAccess.Quit
End Sub
Sub printAcc()
Dim MSAccess As New Access.Application
MSAccess.OpenCurrentDatabase App.Path & "\whcbank.mdb"
MSAccess.DoCmd.OpenReport "明细报表", acViewNormal
MSAccess.CloseCurrentDatabase
MSAccess.Quit
End Sub |
|