PDA

Click to See Complete Forum and Search --> : Print Grid on the Printer (2)


Matt-D
Jan 10th, 2000, 11:41 AM
English:
There is a grid filled by an Access 1.10 database and I want to print it out on the
printer, but with the method I know the printer only gives out an empty paper:

Printer.Print Grid1
Printer.EndDoc
How must I write the code (in VB3, but normally this doesn't matter)

Thanks for some help, Matthias

Deutsch:
Die Tabelle in meier Form wird über Access 1.10 gefüllt und nun möchte ich die
Ergebnisse ausdrucken, aber mit der Methode die ich kenne (s.o.), kommt nur ein leeres Blatt.

Was muß ich hier tun (VB3)

Danke für ein paar Tips, Matthias

Aaron Young
Jan 10th, 2000, 11:47 AM
I'll assume you're using a Databound Grid..
The easiest method would probably be just to traverse the underlying Recordset and print the Data directly from there, something like:

Private Sub Command1_Click()
Dim X As Integer
Dim Y As Integer

Printer.FontName = "Courier"
With Data1.Recordset
For Y = 0 To .RecordCount - 1
For X = 0 To .Fields.Count - 1
Printer.Print .Fields(X).Value; " ";
Next
Printer.Print
Next
End With
End Sub


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com