Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making an Access Report look like a spreadsheet grid 1

Status
Not open for further replies.

djdeuph

MIS
Feb 13, 2002
14
US
I am attempting to make a report in Access that is very similar to an Excel spreadsheet I was using previously. The challenge now is creating lines that would simulate the idea of cell borders in Excel. I've tried a couple of different ideas. First, I looked at the border properties of the text box control but could not set it to only show the right and left borders. Then, I had tried to draw individual vertical lines between each text box but these lines do not grow when the text box grows for larger "cells". I am not interested in creating a module or VBA code to accomplish this as the project needs to be able to be maintained by someone without VBA or coding ability.

Thanks!

Derek
 
I doubt this can be accomplished without VBA in the On Print event of the report section.

There are some tasks that you either use the tool or you go without. This might be one of them.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
OK, let's say I cave and go the VBA route. I have found the option used in another post where in the Print event of the report's Detail, the designated vertical lines grow to the size of the biggest field's height. It still leaves me with a slight gap and in some records the biggest field varies. Any thoughts?

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim intGrownHeight As Integer
Dim ctl As Control
'txtControlDescription is the tallest text box
intGrownHeight = Me.txtControlDescription.Height
For Each ctl In Me.Detail.Controls
If ctl.Tag = "Line" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(0, intGrownHeight)
End If
Next
End Sub
 
I'm not sure where your gap is coming from: above or below your rectangles.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim intGrownHeight As Integer
    Dim ctl As Control
    'txtControlDescription is the tallest text box
    intGrownHeight = Me.txtControlDescription.Height
    'test another control to see if it is higher
    If Me.txtControlAnotherOne.Height > intGrownHeight Then
        intGrownHeight =  Me.txtControlAnotherOne.Height 
    End If
    For Each ctl In Me.Detail.Controls
        If ctl.Tag = "Line" Then
            Me.Line (ctl.Left, ctl.Top)- _
                Step(0, intGrownHeight)
        End If
    Next
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top