说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

VB 如何将dbgrid印出来

HTML文档下载 WORD文档下载 PDF文档下载
VB 如何将dbgrid印出来

Option Explicit
Private Sub Command1_Click()
Dim I As Long, J As Long, K As Long
Dim PrintString As String
For I = 0 To Data1.Recordset.RecordCount - 1
If K = DBGrid1.VisibleRows Then
DBGrid1.Scroll 0, DBGrid1.VisibleRows
K = 0
End If
For J = 0 To DBGrid1.Columns.Count - 1
PrintString = PrintString &
DBGrid1.Columns(J).CellText(DBGrid1.RowBookmark(K)) & "/"
Next
Printer.Print PrintString
PrintString = ""
K = K + 1
DoEvents
Next
End Sub

Private Sub Form_Activate()
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
End Sub
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘