Aligning borders to text boxes in a report (1 Viewer)

anb001

Registered User.
Local time
Tomorrow, 00:36
Joined
Jul 5, 2004
Messages
197
Attached is a database, I previously found on a forum a few years ago, which can align the borders of text boxes on a report, to they all have the same height, depending of amount of text inside.

As such it works fine. But there is a flaw. In the first row of text boxes shown on the report, text are being cut off, and the text boxes in the first row are a bit higher than they should be.

I have tried to see if I could find the problem, but haven't been successful. This database was made in Access 2003 (I assume), and is converted when I open it in Access 2010. Could that be the problem, that it doesn't work 100% with Access 2010? If so, can someone perhaps help with the issue, so it will work properly in Access 2010?

Thanks.
 

Attachments

  • Access Report Allign borders for text boxes.mdb
    172 KB · Views: 224
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 23:36
Joined
Jul 9, 2003
Messages
16,426
I cannot view the database it is in a format that is not accessible to me.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:36
Joined
May 7, 2009
Messages
19,249
can you post the updated version (A2010).
 

GinaWhipp

AWF VIP
Local time
Today, 18:36
Joined
Jun 21, 2011
Messages
5,899
Database attached in in 97 format and looks fine, so... I'm going so that when you convert it the problem happens. Please upload the converted one.
 

anb001

Registered User.
Local time
Tomorrow, 00:36
Joined
Jul 5, 2004
Messages
197
Sorry for late reply. Have been without internet for a few days.

I have attached the converted file (2007 format).

I have also found another way of getting the borders aligned. Access MVP Duane Hookom has posted below code at another forum. By leaving borders transparent, and add the word "border" in the tag properties, it works fine.

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
 

Attachments

  • Access Report Allign borders for text boxes.accdb
    768 KB · Views: 213

Users who are viewing this thread

Top Bottom