本帖最后由 asiawen 于 2010-01-15 20:06:56 编辑

解决方案 »

  1.   

    LZ:参阅:[url=http://iask.sina.com.cn/b/2350257.html]如何用VB打印表格?[/url]中的分页代码.
      

  2.   

    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
      

  3.   

    If b >= 29 Then 
    Printer.NewPage 
    Printer.Print " ┌────┬───┬───┬─────────┬────┬──────┬───────────┐" 
    Printer.Print " │ 车牌  │公里  │ 油费 │ 地址            │司机编号│  姓名      │  日期时间            │" 
    b=0
    Else
    b=b+1 
    End If 
    End If 
      

  4.   

    不明白,为什么要用b >= 29,而且也没有把赋0,这样不会30条记录之后都输出Printer.Print " └────┴───┴───┴─────────┴────┴──────┴───────────┘"
    这个东西吗? 
      

  5.   

    你的代码没缩进, 要一下看清也累人, 以后写代码自己看着办吧.在 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
      

  6.   

    哈哈,是我把问题想复杂了,谢谢你提醒把Adodc4.Recordset.MoveNext这个语句写到判断之前就行了,a a= Text1.Text 哈,这个句语句虽然类型不一,但也没报错哦,这两个是用来做打印份数的。
    For i = 1 To a  这两个是用来做打印份数的。