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  

Label Growing Problems



 
 
Thread Tools Display Modes
  #11  
Old August 11th, 2008, 02:08 AM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Label Growing Problems

No I haven't. Tell me what I need to do. Do I just copy and paste the code
again but put the last Me.Line code to vbGray, BF?

Ben

"Duane Hookom" wrote:

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

  #12  
Old August 11th, 2008, 02:39 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Label Growing Problems

That would be my first try. Let us know your results.

--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

No I haven't. Tell me what I need to do. Do I just copy and paste the code
again but put the last Me.Line code to vbGray, BF?

Ben

"Duane Hookom" wrote:

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

  #13  
Old August 11th, 2008, 02:59 AM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Label Growing Problems

I got an error message:

Duplicate declaration in current scope.

Ben

"Duane Hookom" wrote:

That would be my first try. Let us know your results.

--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

No I haven't. Tell me what I need to do. Do I just copy and paste the code
again but put the last Me.Line code to vbGray, BF?

Ben

"Duane Hookom" wrote:

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

  #14  
Old August 11th, 2008, 03:39 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Label Growing Problems

Please provide your code and identify the line that causes the error.

--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

I got an error message:

Duplicate declaration in current scope.

Ben

"Duane Hookom" wrote:

That would be my first try. Let us know your results.

--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

No I haven't. Tell me what I need to do. Do I just copy and paste the code
again but put the last Me.Line code to vbGray, BF?

Ben

"Duane Hookom" wrote:

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

  #15  
Old August 11th, 2008, 04:20 AM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Label Growing Problems

Here is my code. This does not work at all. The label grows with its
respective memo field, but the background of the memo is gray, not the label.
The lines seem heavy and it doesn't appear to look good.

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

Dim intMaxHeight1 As Integer
Dim ctl1 As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
If ctl1.Height intMaxHeight1 Then
intMaxHeight1 = ctl1.Height
End If
End If
Next
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If
Next

Again, what I want to do is have the Label of each memo field (3 of them)
grow with the memo. I want the Label to fill with gray in the background and
draw a box around the label too. Finally, I want the background to be none
on the memo fields and the lines around everything to look good and hairline.

Thanks

Ben
  #16  
Old August 11th, 2008, 06:14 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Label Growing Problems

Set the label tag to BorderFill and try code like:
Dim intMaxHeight1 As Integer
Dim ctl1 As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
If ctl1.Height intMaxHeight1 Then
intMaxHeight1 = ctl1.Height
End If
End If
Next
Me.DrawWidth = 1
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), vbBlack, B

End If
If ctl1.Tag = "BorderFill" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight), vbBlack, B
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If

Next
--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

Here is my code. This does not work at all. The label grows with its
respective memo field, but the background of the memo is gray, not the label.
The lines seem heavy and it doesn't appear to look good.

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

Dim intMaxHeight1 As Integer
Dim ctl1 As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
If ctl1.Height intMaxHeight1 Then
intMaxHeight1 = ctl1.Height
End If
End If
Next
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If
Next

Again, what I want to do is have the Label of each memo field (3 of them)
grow with the memo. I want the Label to fill with gray in the background and
draw a box around the label too. Finally, I want the background to be none
on the memo fields and the lines around everything to look good and hairline.

Thanks

Ben

  #17  
Old August 11th, 2008, 12:57 PM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Label Growing Problems

Duane,
We're getting closer. It looks like it's almost there. The Label does the
fill in gray, but not the line around the label. It's almost like one and
not the other.

Ben

"Duane Hookom" wrote:

Set the label tag to BorderFill and try code like:
Dim intMaxHeight1 As Integer
Dim ctl1 As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
If ctl1.Height intMaxHeight1 Then
intMaxHeight1 = ctl1.Height
End If
End If
Next
Me.DrawWidth = 1
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), vbBlack, B

End If
If ctl1.Tag = "BorderFill" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight), vbBlack, B
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If

Next
--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

Here is my code. This does not work at all. The label grows with its
respective memo field, but the background of the memo is gray, not the label.
The lines seem heavy and it doesn't appear to look good.

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

Dim intMaxHeight1 As Integer
Dim ctl1 As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
If ctl1.Height intMaxHeight1 Then
intMaxHeight1 = ctl1.Height
End If
End If
Next
'Draw a box around each control in Detail _
that has a tag property of "Border"
For Each ctl1 In Me.Section(0).Controls
If ctl1.Tag = "Border" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If
Next

Again, what I want to do is have the Label of each memo field (3 of them)
grow with the memo. I want the Label to fill with gray in the background and
draw a box around the label too. Finally, I want the background to be none
on the memo fields and the lines around everything to look good and hairline.

Thanks

Ben

  #18  
Old August 11th, 2008, 01:46 PM posted to microsoft.public.access.reports
Ben
external usenet poster
 
Posts: 536
Default Label Growing Problems

Duane,
I got it to work about 99%. The code I have modified is below. The Label
expands and fills in with Gray and draws the line. Now my problem is that
the memo fields have a strange line cutting thru the middle of them. Not
sure why. Here's the code:

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

End If
If ctl1.Tag = "BorderFill" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), vbBlack, B
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If

Next

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
Me.DrawWidth = 0
'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
If ctl.Tag = "BorderFill" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), 12632256, BF
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), vbBlack, B


End If

Next

Thanks

Ben
  #19  
Old August 11th, 2008, 03:46 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Label Growing Problems

My most recent reply had you looping through the controls only once. I'm not
sure why you have "doubled" the code. I don't think you need anything else
from first reference to "ctl"
For Each ctl In Me.Section(0).Controls
--
Duane Hookom
Microsoft Access MVP


"Ben" wrote:

Duane,
I got it to work about 99%. The code I have modified is below. The Label
expands and fills in with Gray and draws the line. Now my problem is that
the memo fields have a strange line cutting thru the middle of them. Not
sure why. Here's the code:

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

End If
If ctl1.Tag = "BorderFill" Then
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), vbBlack, B
Me.Line (ctl1.Left, ctl1.Top)- _
Step(ctl1.Width, intMaxHeight1), 12632256, BF
End If

Next

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
Me.DrawWidth = 0
'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
If ctl.Tag = "BorderFill" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), 12632256, BF
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), vbBlack, B


End If

Next

Thanks

Ben

 




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 06:58 PM.


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