Printing DataGrid in VB

faico -  
 camile -
salam
I'm working on a VB-Access project and I want to print the content of a datagrid without the other controls present on the form. Additionally, the datagrid is not fully displayed and requires scrolling.
Is there a direct method to do this? If not, is there a trick to export the content of the datagrid to Ms Excel?

5 answers

faico
 
Thank you very much!
3
MKA
 
Hello, I am currently working on a project based on Visual Basic. The problem I am facing is as follows: I would like to print the data located just in the datagrid of the form. Thank you in advance for your help.
0
yess
 
```vb Private Sub CmdPrint_Click()
Dim RRow As Integer, RecCount as integer
reccount=adodc1.recordset.recordcount
printer.print ""
For RRow = 0 To 13 ' change this to suit your need
or reccount
DataGrid1.Row = RRow

printer.Print DataGrid1.Columns(0).Text, Space(1), DataGrid1.Columns(1).Text, Space(1), DataGrid1.Columns(2).Text '
Next
printer.enddoc
End Sub ```
0
camile
 
There is no video version for this answer.
0
eliancra Posted messages 78 Status Member 1
 
Hello, since I can't implement these methods, I'm wondering if one of you could help me transfer the data from my datagrid in VB6 to Word or PDF. Thank you.
0
lami20j Posted messages 21506 Registration date   Status Moderator, Security Contributor Last intervention   3 571
 
-1