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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|