Insert gridlines into an Access report

  • Thread starter Thread starter G.
  • Start date Start date
G

G.

I need to insert a couple of table like figures into 1 report - with
gridlines, column headings and all. I have a spreadsheet with info in it
(about 3 columns across and 10 rows down) in Excel. I need something similar
in an access report and I cannot copy and paste because the data in the cells
needs to be bound to the access report. I can import the data into an Access
table but don't know if I can format it in teh Access Report to look the same
way as it does in Excel? Is there any way to do this?

Thank you.
 
Set the border style on all the controls involved to solid. You will
probably need to dink with them until they look like a grid.
 
Thanks. Although I am not experienced with code, I also found out I can do it
with line method code too. If I create a tabular report, then apply the
following code it will encase all info in a grid:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer

' This is the spacing between the right edge of the
' control and the Vertical Seperation Line
intLineMargin = 0
DrawWidth = 8

' OK lets draw a vertical line to seperate each field
' for each control in details control
' If your last control on the right does not end on the edge of the section
' you will get a second vertical line. If you need to get around this then you
' can skip drawing this last Vertical Seperation Line in a couple of ways.
' We'll use the control name method Here. Our right most control is named
' TestMemo. IF current control is TestMemo - Do not print Vertical Line
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
'If CtlDetail.name <> "TestMemo" Then
Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
'End If
End With
Next

'While we are here lets draw a box around the Detail section
With Me
Me.Line (0, 0)-Step(.Width, .Height), 0, B
End With

Set CtlDetail = Nothing

End Sub


Apparently, there are other ways to do it. It's just confusing for a person
like me who has not used code yet.

Thanks again!
 
I suggested the border method because it is simple and takes no code. The
Line method, however, does work well.
 
Back
Top