2个窗体A 和 BA窗体是查询功能,B窗体是打印的发票格式我现在想做的是批量打印,在A窗体查询的数据,点击批量打印按钮,调用B窗体 然后 Me.PrintForm.现在的问题是可以打印,但问题是 在打印过程中如果打印机夹纸了,停止打印机,在开机就不按我正常的格式打印了,一下子进了很多张,我打印机的打印列表都清楚,重新打印的话 就不知道打印在什么位置了? 高手指点下啊 我代码如下 B窗体代码Dim rs21 As New ADODB.Recordset
sql21 = "select * from 明细表log where id in(select id from print_id where name='" & Trim(v_denglu.v_name1) & "')"
rs21.Open sql21, db
bb = 0
Do While Not rs21.EOFxm.Caption = rs21("姓名") & " 编号:" & rs21("编号")nian.Caption = Year(Date)
yue.Caption = Month(Date)
ri.Caption = Day(Date)
fm.Caption = "收缴费用月份是:" & rs21("月份")byf.Caption = FormatNumber((rs21("保育费")), 2)hsf.Caption = FormatNumber(Trim(rs21("伙食费")), 2)wsf.Caption = FormatNumber(Trim(rs21("卫生费")), 2)byfbz.Caption = "出勤超过10天(不含10天),收取全额;否则收取半额;"ts.Caption = rs21("出勤天数")banbie.Caption = rs21("班别")
hsfbz.Caption = "每天" & s_huoshi & "元,当月共出勤天数为:" & ts.Caption & "天;"
heji.Caption = FormatNumber(rs21("减免后合计"), 2)'装换大小写Call Num2Chi(rs21("减免后合计"))
'更新打印催款单标记
Dim rsc1 As New ADODB.Recordset
Dim sqlc1 As String
sqlc1 = "update 明细表log set 打印1='1' where id =" + Trim(rs21("id"))
rsc1.Open sqlc1, db
Set rsc1 = Nothing
'A窗体的ID传到print_id 里,打印完就删除ID
Dim rsa1 As New ADODB.Recordset
Dim sqla1 As String
sqla1 = "delete print_id where id =" + Trim(rs21("id"))
rsa1.Open sqla1, db
Set rsa1 = Nothing
Me.PrintForm
rs21.MoveNext
bb = bb + 1
Loop
Set rs21 = Nothing
sql21 = "select * from 明细表log where id in(select id from print_id where name='" & Trim(v_denglu.v_name1) & "')"
rs21.Open sql21, db
bb = 0
Do While Not rs21.EOFxm.Caption = rs21("姓名") & " 编号:" & rs21("编号")nian.Caption = Year(Date)
yue.Caption = Month(Date)
ri.Caption = Day(Date)
fm.Caption = "收缴费用月份是:" & rs21("月份")byf.Caption = FormatNumber((rs21("保育费")), 2)hsf.Caption = FormatNumber(Trim(rs21("伙食费")), 2)wsf.Caption = FormatNumber(Trim(rs21("卫生费")), 2)byfbz.Caption = "出勤超过10天(不含10天),收取全额;否则收取半额;"ts.Caption = rs21("出勤天数")banbie.Caption = rs21("班别")
hsfbz.Caption = "每天" & s_huoshi & "元,当月共出勤天数为:" & ts.Caption & "天;"
heji.Caption = FormatNumber(rs21("减免后合计"), 2)'装换大小写Call Num2Chi(rs21("减免后合计"))
'更新打印催款单标记
Dim rsc1 As New ADODB.Recordset
Dim sqlc1 As String
sqlc1 = "update 明细表log set 打印1='1' where id =" + Trim(rs21("id"))
rsc1.Open sqlc1, db
Set rsc1 = Nothing
'A窗体的ID传到print_id 里,打印完就删除ID
Dim rsa1 As New ADODB.Recordset
Dim sqla1 As String
sqla1 = "delete print_id where id =" + Trim(rs21("id"))
rsa1.Open sqla1, db
Set rsa1 = Nothing
Me.PrintForm
rs21.MoveNext
bb = bb + 1
Loop
Set rs21 = Nothing
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货