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
|
|||
|
|||
Label Growing Problems
I have three memo labels on my report that I have growing with their related
memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#2
|
|||
|
|||
Label Growing Problems
If we can assume the label borders are being drawn with the Line method, you
should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#3
|
|||
|
|||
Label Growing Problems
Duane,
I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#4
|
|||
|
|||
Label Growing Problems
That looks like my original code. Why do you want to "draw the line around
the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#5
|
|||
|
|||
Label Growing Problems
Duane,
The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#6
|
|||
|
|||
Label Growing Problems
Do you want to put separate borders around each of the labels associated with
the memo text boxes? Do they all have their own border? Have you tried entering "border" in the tag property of the label controls? -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#7
|
|||
|
|||
Label Growing Problems
Duane,
I want the label box to grow with the memo box and have a border around both, but have the background of the Label be gray. I have the following Fields ActionItems_Label ActionItemsMemo ActionItemsOverdue_Label ActionItemsOverdueMemo Other_Label Other_Memo Each of the labels need to grow with the field and also produce a border around it and have a background color of gray. Thanks Ben "Duane Hookom" wrote: Do you want to put separate borders around each of the labels associated with the memo text boxes? Do they all have their own border? Have you tried entering "border" in the tag property of the label controls? -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#8
|
|||
|
|||
Label Growing Problems
What results do you get that make you think " It doesn't seem to work right"?
Are the labels to the left of the memo text boxes? Is that why you want them to grow vertically? -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#9
|
|||
|
|||
Label Growing Problems
The labels expand and they get borders drawn, but when I have it "paint" the
background with gray, the lines on the perimeter go away. It looks like the boxes don't draw correctly. The bottom box, OtherMemo doesn't have a bottom line drawn around the box. So it all looks weird. Need to figure out how to get the Line code and the other code to work. Ben "Duane Hookom" wrote: What results do you get that make you think " It doesn't seem to work right"? Are the labels to the left of the memo text boxes? Is that why you want them to grow vertically? -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
#10
|
|||
|
|||
Label Growing Problems
If you want a line around the label as well as a fill, you may need to use
the Line method twice. Have you tried this? -- Duane Hookom Microsoft Access MVP "Ben" wrote: The labels expand and they get borders drawn, but when I have it "paint" the background with gray, the lines on the perimeter go away. It looks like the boxes don't draw correctly. The bottom box, OtherMemo doesn't have a bottom line drawn around the box. So it all looks weird. Need to figure out how to get the Line code and the other code to work. Ben "Duane Hookom" wrote: What results do you get that make you think " It doesn't seem to work right"? Are the labels to the left of the memo text boxes? Is that why you want them to grow vertically? -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, The box is a memo field with accompanying label. I changed the border on all the fields to Transparent and put Border on each Tag. It doesn't seem to work right. Ben "Duane Hookom" wrote: That looks like my original code. Why do you want to "draw the line around the box"? A box should already be a line. Perhaps you are referring to some other kind of box. -- Duane Hookom Microsoft Access MVP "Ben" wrote: Duane, I have the following code and the code from before 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 How do I get these two to work together and draw the line around the box? Ben "Duane Hookom" wrote: If we can assume the label borders are being drawn with the Line method, you should be able to set the DrawWidth property to skinny the line. -- Duane Hookom Microsoft Access MVP "Ben" wrote: I have three memo labels on my report that I have growing with their related memo field. ActionItems, ActionItemsOverdue, Other. The code works below works as in it allows the label to grow with the Memo. My problem is that after the label grows I want the border to change to hairline for each Label. Code Below: Dim lngHeight As Long Dim lngHeight1 As Long Dim lngHeigh2 As Long Dim X1 As Single Dim Y1 As Single Dim Y2 As Single Dim X2 As Single Dim A1 As Single Dim A2 As Single Dim A3 As Single Dim A4 As Single Dim B1 As Single Dim B2 As Single Dim B3 As Single Dim B4 As Single Me.DrawStyle = 0 lngHeight = Me.Action_Items.Height lngHeight1 = Me.ActionItemsOverdue.Height lngHeight2 = Me.Other.Height X1 = ActionItems_Label.Left A1 = ActionItemsOverdue_Label.Left B1 = Other_Label.Left X2 = ActionItems_Label.Left + ActionItems_Label.Width A4 = ActionItemsOverdue_Label.Left + ActionItemsOverdue_Label.Width B4 = Other_Label.Left + Other_Label.Width Y1 = ActionItems_Label.Top A2 = ActionItemsOverdue_Label.Top B2 = Other_Label.Top Y2 = ActionItems_Label.Top + lngHeight A3 = ActionItemsOverdue_Label.Top + lngHeight1 B3 = Other_Label.Top + lngHeight2 Me.Line (X1, Y1)-(X2, Y2), 12632256, BF Me.Line (A1, A4)-(A2, A3), 12632256, BF Me.Line (B1, B4)-(B2, B3), 12632256, BF Thanks, Ben |
|
Thread Tools | |
Display Modes | |
|
|