|
-
Nov 22nd, 1999, 09:32 PM
#1
Thread Starter
New Member
Does anybody know if there is a way to print just the information in a DBgrid from a form and not the complete form??
-
Nov 22nd, 1999, 09:58 PM
#2
You could just print the Info from the Underlying DataSource which the Grid is Bound to, eg.
Code:
Private Sub Command1_Click()
Dim sLine As String
Dim iIndex As Integer
With Data1.Recordset
.MoveFirst
While Not .EOF
sLine = ""
For iIndex = 0 To .Fields.Count - 1
sLine = sLine & Chr(9) & .Fields(iIndex)
Next
Printer.Print Mid$(sLine, 2)
.MoveNext
Wend
End With
Printer.EndDoc
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Nov 22nd, 1999, 11:37 PM
#3
If you just want to see the info that is currently being displayed in your grid and you have a "Print" button on the form, you can put code behind that button to temporarily make everything except the grid .Visible = False, and then make them visible again when printing is done.
------------------
Marty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|