A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Drawing lines around multple text boxes in Detail section



 
 
Thread Tools Display Modes
  #1  
Old August 1st, 2006, 07:22 PM posted to microsoft.public.access.reports
RatherBeeHome
external usenet poster
 
Posts: 29
Default Drawing lines around multple text boxes in Detail section

Hello,

I have several text boxes pressed together in the detail section of a report
that I want lines to be drawn around. I have the border set to 1 point for
all of these text boxes. They are the same height. A few of the text boxes
have large strings in them, which I want the text box to grow accordingly. I
have the "Can Grow" property set to True. This works fine. The problem I'm
having is I want all the other text boxes to be the same size so it will look
uniform. How can I achieve this?

Thanks
  #2  
Old August 1st, 2006, 08:08 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 2,251
Default Drawing lines around multple text boxes in Detail section

I would:
- select all the text boxes
- remove the borders
- enter "Border" in all of their Tag properties
- Add this code to the On Print event of your detail section:

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 all controls 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), , B
End If
Next
End Sub

--
Duane Hookom
MS Access MVP

"RatherBeeHome" wrote in message
...
Hello,

I have several text boxes pressed together in the detail section of a
report
that I want lines to be drawn around. I have the border set to 1 point
for
all of these text boxes. They are the same height. A few of the text
boxes
have large strings in them, which I want the text box to grow accordingly.
I
have the "Can Grow" property set to True. This works fine. The problem
I'm
having is I want all the other text boxes to be the same size so it will
look
uniform. How can I achieve this?

Thanks



  #3  
Old August 1st, 2006, 09:33 PM posted to microsoft.public.access.reports
RatherBeeHome
external usenet poster
 
Posts: 29
Default Drawing lines around multple text boxes in Detail section

Thanks! That worked like a charm!

"Duane Hookom" wrote:

I would:
- select all the text boxes
- remove the borders
- enter "Border" in all of their Tag properties
- Add this code to the On Print event of your detail section:

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 all controls 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), , B
End If
Next
End Sub

--
Duane Hookom
MS Access MVP

"RatherBeeHome" wrote in message
...
Hello,

I have several text boxes pressed together in the detail section of a
report
that I want lines to be drawn around. I have the border set to 1 point
for
all of these text boxes. They are the same height. A few of the text
boxes
have large strings in them, which I want the text box to grow accordingly.
I
have the "Can Grow" property set to True. This works fine. The problem
I'm
having is I want all the other text boxes to be the same size so it will
look
uniform. How can I achieve this?

Thanks




  #4  
Old July 25th, 2007, 10:12 PM posted to microsoft.public.access.reports
Sajit
external usenet poster
 
Posts: 32
Default Drawing lines around multple text boxes in Detail section

My problem is closest to what you have resolved below, with the difference,

I have 3 controls in a row a1, a2, a3 and another row with b1, b2, b3

All the controls are sourced to a single record.

Row b is just below a, such that if 'a' grows, then b has to move by that
much down to make way. Also, all of the controls in a, a1, a2, a3 should have
the same height after one of them is required to grow to accomodate the
longer text that one of them will have in that record.

I have tried to set the .top of the b row of the controls. The help tells me
that .top property in a report is read only.

How can this be done?

--
Sajit
Abu Dhabi


"RatherBeeHome" wrote:

Thanks! That worked like a charm!

"Duane Hookom" wrote:

I would:
- select all the text boxes
- remove the borders
- enter "Border" in all of their Tag properties
- Add this code to the On Print event of your detail section:

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 all controls 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), , B
End If
Next
End Sub

--
Duane Hookom
MS Access MVP

"RatherBeeHome" wrote in message
...
Hello,

I have several text boxes pressed together in the detail section of a
report
that I want lines to be drawn around. I have the border set to 1 point
for
all of these text boxes. They are the same height. A few of the text
boxes
have large strings in them, which I want the text box to grow accordingly.
I
have the "Can Grow" property set to True. This works fine. The problem
I'm
having is I want all the other text boxes to be the same size so it will
look
uniform. How can I achieve this?

Thanks




  #5  
Old July 26th, 2007, 06:01 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Drawing lines around multple text boxes in Detail section

Sajit wrote:

My problem is closest to what you have resolved below, with the difference,

I have 3 controls in a row a1, a2, a3 and another row with b1, b2, b3

All the controls are sourced to a single record.

Row b is just below a, such that if 'a' grows, then b has to move by that
much down to make way. Also, all of the controls in a, a1, a2, a3 should have
the same height after one of them is required to grow to accomodate the
longer text that one of them will have in that record.

I have tried to set the .top of the b row of the controls. The help tells me
that .top property in a report is read only.



Why would you want to set the Top property in the Print
event? As far I can see, that is automatic if all the a
text boxes have their CanGrow property set to Yes and the
top of the b text boxes are below the bottom of the a text
boxes.

Duane's code should work as is for the a text boxes, but you
will need to change it a little to do the b text boxes too.
Set the Tag property of the b textboxes to Border2:

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
Dim intMaxHeight As Integer
Dim intMaxHeight2 As Integer
Dim ctl As Control

For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
If ctl.Height intMaxHeight Then
intMaxHeight = ctl.Height
End If
ElseIf ctl.Tag = "Border2" Then
If ctl.Height intMaxHeight2 Then
intMaxHeight2 = ctl.Height
End If
End If
Next

For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), , B
ElseIf ctl.Tag = "Border2" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight2), , B
End If
Next
End Sub

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.