If b >= 29 Then Printer.Print " └────┴───┴───┴─────────┴────┴──────┴───────────┘" End If If Not Adodc4.Recordset.EOF Then Adodc4.Recordset.MoveNext If Adodc4.Recordset.EOF then Printer.EndDoc Printer.KillDoc Exit Sub Else If b >= 29 Then Printer.NewPage Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐" Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │" End If b=b+1 End If Loop
If b >= 29 Then Printer.NewPage Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐" Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │" b=0 Else b=b+1 End If End If
你的代码没缩进, 要一下看清也累人, 以后写代码自己看着办吧.在 3F的代码给你补上了 b=0 没看到吗?a = Text1.Text For i = 1 To a 不知道你这是干啥的, 但很明显的错误是 a = Val(Text1.Text)'****************************************************** 2F 3F 是还有个漏洞再给你补上吧If Not Adodc4.Recordset.EOF Then Adodc4.Recordset.MoveNext If Adodc4.Recordset.EOF Or b >= 29 Then Printer.Print " └────┴───┴───┴─────────┴────┴──────┴───────────┘" If Adodc4.Recordset.EOF Then Printer.EndDoc Printer.KillDoc Exit Sub Else Printer.NewPage Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐" Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │" End If b = 0 Else b = b + 1 End If Loop
哈哈,是我把问题想复杂了,谢谢你提醒把Adodc4.Recordset.MoveNext这个语句写到判断之前就行了,a a= Text1.Text 哈,这个句语句虽然类型不一,但也没报错哦,这两个是用来做打印份数的。 For i = 1 To a 这两个是用来做打印份数的。
Printer.Print " └────┴───┴───┴─────────┴────┴──────┴───────────┘"
End If
If Not Adodc4.Recordset.EOF Then Adodc4.Recordset.MoveNext
If Adodc4.Recordset.EOF then
Printer.EndDoc
Printer.KillDoc
Exit Sub
Else
If b >= 29 Then
Printer.NewPage
Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐"
Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │"
End If
b=b+1
End If
Loop
Printer.NewPage
Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐"
Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │"
b=0
Else
b=b+1
End If
End If
这个东西吗?
For i = 1 To a
不知道你这是干啥的, 但很明显的错误是 a = Val(Text1.Text)'******************************************************
2F 3F 是还有个漏洞再给你补上吧If Not Adodc4.Recordset.EOF Then Adodc4.Recordset.MoveNext
If Adodc4.Recordset.EOF Or b >= 29 Then
Printer.Print " └────┴───┴───┴─────────┴────┴──────┴───────────┘"
If Adodc4.Recordset.EOF Then
Printer.EndDoc
Printer.KillDoc
Exit Sub
Else
Printer.NewPage
Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐"
Printer.Print " │ 车牌 │公里 │ 油费 │ 地址 │司机编号│ 姓名 │ 日期时间 │"
End If
b = 0
Else
b = b + 1
End If
Loop
For i = 1 To a 这两个是用来做打印份数的。