VB如何将DBgrid印出来
get新技能是需要付出行动的,即使看得再多也还是要动手试一试。今天图老师小编跟大家分享的是VB如何将DBgrid印出来,一起来学习了解下吧!
PrivateSubCommand1_Click()
DimIAsLong,JAsLong,KAsLong
DimPrintStringAsString
ForI=0ToData1.Recordset.RecordCount-1
IfK=DBGrid1.VisibleRowsThen
DBGrid1.Scroll0,DBGrid1.VisibleRows
K=0
EndIf
ForJ=0ToDBGrid1.Columns.Count-1
PrintString=PrintString&
DBGrid1.Columns(J).CellText(DBGrid1.RowBookmark(K))&"/"
Next
Printer.PrintPrintString
PrintString=""
K=K 1
DoEvents
Next
EndSub
PrivateSubForm_Activate()
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
EndSub->->