With ctlGrid
PTab = 19 'Set the first tab value
Printer.Print vbCr;
Printer.Print vbCr;
Printer.Print vbCr;
For J = 0 To .Columns.Count - 1
.Col = J 'Set the current column
'Send the field to the print line and add the tab.
'Notice the semicolon at the end of the line.
'Printer.Print Tab(PTab);
Printer.FontBold = True
Printer.Orientation = 2 'Here is what i tried to change orietnation for testing
Printer.Print Tab(PTab); Trim$(.Columns(J).Caption);
PTab = PTab + 37 'Increment the tab value
Next
Printer.Print
Printer.Print vbCr;
Printer.Print vbCr;
Printer.Print vbCr;
For I = 0 To .ApproxCount - 1
PTab = 20 'Set the first tab value
'This checks to see if a page break is needed
If Printer.CurrentY + Printer.TextHeight(.Text) > Printer.ScaleHeight - 600 Then
Printer.NewPage
PTab = 19 'Set the first tab value
Printer.Print vbCr;
Printer.Print vbCr;
Printer.Print vbCr;
For J = 0 To .Columns.Count - 1
.Col = J 'Set the current column
'Send the field to the print line and add the tab.
'Notice the semicolon at the end of the line.
'Printer.Print Tab(PTab);
Printer.FontBold = True
Printer.Print Tab(PTab); Trim$(.Columns(J).Caption);
PTab = PTab + 37 'Increment the tab value
Next
Printer.Print
Printer.Print vbCr;
Printer.Print vbCr;
Printer.Print vbCr;
End If
Printer.Print
PTab = 20 'set First Tab
For J = 0 To .Columns.Count - 1
.Col = J 'Set the current column
'Send the field to the print line and add the tab.
'Notice the semicolon at the end of the line.
Printer.FontBold = False
Printer.Print Tab(PTab); Trim$(.Text);
PTab = PTab + 40 'Increment the tab value
Next
'After each column has printed to the print line
'a Printer.Print statement without a semicolon will
'will send the line to the printer and start a new
'one.
Printer.Print
On Error Resume Next
.Row = .Row + 1 'Set the active row
On Error GoTo 0
Next I
End With
Printer.EndDoc
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE