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!

Grouping As Field Grows

Status
Not open for further replies.

naturalsn

Technical User
Apr 26, 2007
68
GB
Good Day

I was hoping someone could perhaps give some advise. I currently have a report with 5 fields next to on another indicating
Institute Name, Course Taken, Date From, Date To, Degree Obtained
With a black border around each to give it a table format.

This is running from a table to a query, wich then print the individual report per person.

The details from person to person change. So someones degree obtained is 255 Caracters and the other 10. Now i have set all the records to shrink and grow. Let say Degree obtained grew, my First 4 texbox fields stay the same size. so i loose the layout of a table.

Is it possible to allow all the textboxes to grow to the same size, as another grows. So i can keep my table format.

Any help would be appreciated

Regards
Sn
 
You can remove all the borders from your controls and use the Line method in code to draw borders/rectangles. You would set the Tag property of each control that you want border to "Border".

This is the code to enter into the On Print event code window for the detail section.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim intMaxHeight As Integer
    Dim ctl As Control
    'Find highest control in Detail section _
      that has a tag property of "Border"
    For Each ctl In Me.Section(0).Controls
        If ctl.Tag = "Border" Then
            If ctl.Height > intMaxHeight Then
                intMaxHeight = ctl.Height
            End If
        End If
    Next
    'Draw a box around each control in Detail _
      that has a tag property of "Border"
    For Each ctl In Me.Section(0).Controls
        If ctl.Tag = "Border" Then
            Me.Line (ctl.Left, ctl.Top)- _
                Step(ctl.Width, intMaxHeight), vbBlack, B
        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]
 
Hi

Thank you very much for your response.

I have removed all border settings,
Used the code you provided
Set the the Tab property of each txtbox to "border",
Saved and printed.
The spacing works perfectly just no border.
I think i might be missing something. Any advise
 
I don't understand what you mean by "the spacing works perfectly". How do you know this if you can't see the border?

Can you post back your exact code?

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]
 
Hi, sorry about spacing

This is what i have on Detail Print Event

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim intMaxHeight As Integer
Dim ctl As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
If ctl.Height > intMaxHeight Then
intMaxHeight = ctl.Height
End If
End If
Next
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), vbBlack, B
End If
Next
End Sub
 
Hi dhookom

My fault, tagged "Border" not border

Thank you so much for your help and time..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top