Grid lines

alfred67

Registered User.
Local time
Yesterday, 19:16
Joined
Jan 26, 2010
Messages
65
Hello

Is there an easy way to add grid lines to my report ?? (like in excel) I'm running Access 2003

Thank you

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

intLineMargin = 60

For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail

Me.Line ((.left + .Width + intLineMargin), 0)-(.left + .Width + _
intLineMargin, Me.Height)

End With
Next
With Me
Me.Line (0, 0)-Step(.Width, .Height), 0, B
End With
Set CtlDetail = Nothing
End Sub
 
Thank you .
Next Question where do I put this code?? On Click ?? On Page??


Alfred67
 
Thank you.

That gave me vertical lines is there away to get horizontal too Or did I miss something??

Alfred67
 
Last edited:
Thank you.

That gave me vertical lines is there away to get horizontal too Or did I miss something??

Alfred67

I'm not entirely sure. Press F1 in the VBA editor and when the help window comes up, enter "Line Method" as the search string. There's an example there. If you get stuck post back and I'll have a look to see if I can make some sense of it.
 
Why not just put a horizontal line across the bottom of your details section (or the top,whichever works) and then it will work with the code to create a grid.
 
Hello

Sorry doing reports in access in new to me. I had it backwards it gives me horizontal, I need vertical too.

See attched screen shot

Thanks for the help

Alfred67
 

Attachments

Do the same as what you've already done for horizontal. Draw a vertical at the postion(s) where you want it or them. Access will continue to draw till the end of the report
 
Do you have any Control text boxes on your Report?
 
If you mean do my text boxes have a control source then Yes

Alfred67
 
Actually on second thoughts you do not need to add lines anywhere, go into the design view of your Report, make sure none of the controls is overlapping and set their Display Property to Yes
 
Sorry Rich you are starting to lose me none of my Text boxes over lap and all are set to be visible.

Sorry about this access is fairly new to me

Alfred67
 
The border around the textboxes needs to be set to visible
 
Hello

I got it to work found my error . My bad

Thanks for the help

Alfred67
 

Users who are viewing this thread

Back
Top Bottom