Make text boxes the same height

I have 3 seperate text boxes that are side by side on a report, they vary in 
height and can grow, I want to put a solid box around each but I want them 
all to default to the tallest so as they look uniform when printed.
I have spent a long time looking at other posts and trying some OnPrint 
event procedures but with no luck so far.
I hope someone can help, thanks in advance
0
Utf
3/13/2008 5:07:08 PM
access.reports 4434 articles. 0 followers. Follow

12 Replies
1905 Views

Similar Articles

[PageSpeed] 19

Open your report in Design View and right click on your textbox and open the 
properties. Under the Format tab you will see a Width and Height field. These 
are the fields to adjust your textbox. 

If you hold down the shift key and click on each one to higlight them all 
(or drag your mouse across all three) then right click on any of them open 
the properties menu, and enter your dimensions and it will adjust all three 
at the same time so you only have to do it once.

"AnnieJ" wrote:

> I have 3 seperate text boxes that are side by side on a report, they vary in 
> height and can grow, I want to put a solid box around each but I want them 
> all to default to the tallest so as they look uniform when printed.
> I have spent a long time looking at other posts and trying some OnPrint 
> event procedures but with no luck so far.
> I hope someone can help, thanks in advance
0
Utf
3/13/2008 6:22:00 PM
You need to use the Line method of your report to draw the rectangles around 
your controls. Remove the borders of all text boxes and set their Tag 
property to "Border". Then add code to the On Print event of the section 
containing the can grow controls.

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
-- 
Duane Hookom
Microsoft Access MVP


"AnnieJ" wrote:

> I have 3 seperate text boxes that are side by side on a report, they vary in 
> height and can grow, I want to put a solid box around each but I want them 
> all to default to the tallest so as they look uniform when printed.
> I have spent a long time looking at other posts and trying some OnPrint 
> event procedures but with no luck so far.
> I hope someone can help, thanks in advance
0
Utf
3/13/2008 8:04:00 PM
I have tried this before from another post of yours but have had no luck, I 
have tried it again but still not working.  What do you mean by "You need to 
use the Line method of your report to draw the rectangles around your 
controls.".  Do you mean draw 4 lines around my text boxes to make a 
rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
sure.

"Duane Hookom" wrote:

> You need to use the Line method of your report to draw the rectangles around 
> your controls. Remove the borders of all text boxes and set their Tag 
> property to "Border". Then add code to the On Print event of the section 
> containing the can grow controls.
> 
> 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
> -- 
> Duane Hookom
> Microsoft Access MVP
> 
> 
> "AnnieJ" wrote:
> 
> > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > height and can grow, I want to put a solid box around each but I want them 
> > all to default to the tallest so as they look uniform when printed.
> > I have spent a long time looking at other posts and trying some OnPrint 
> > event procedures but with no luck so far.
> > I hope someone can help, thanks in advance
0
Utf
3/14/2008 9:04:00 AM
Annie,

If all you're looking to do is place a border around the field so when 
veiwing the report the data shows in a black box go into the properties of 
that text box and change the border width from Hairline to 1pt. or however 
thick you want it. I also explained how to get them all the same size so you 
should be good to go unless I am not getting what your asking for.

"AnnieJ" wrote:

> I have tried this before from another post of yours but have had no luck, I 
> have tried it again but still not working.  What do you mean by "You need to 
> use the Line method of your report to draw the rectangles around your 
> controls.".  Do you mean draw 4 lines around my text boxes to make a 
> rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
> sure.
> 
> "Duane Hookom" wrote:
> 
> > You need to use the Line method of your report to draw the rectangles around 
> > your controls. Remove the borders of all text boxes and set their Tag 
> > property to "Border". Then add code to the On Print event of the section 
> > containing the can grow controls.
> > 
> > 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
> > -- 
> > Duane Hookom
> > Microsoft Access MVP
> > 
> > 
> > "AnnieJ" wrote:
> > 
> > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > height and can grow, I want to put a solid box around each but I want them 
> > > all to default to the tallest so as they look uniform when printed.
> > > I have spent a long time looking at other posts and trying some OnPrint 
> > > event procedures but with no luck so far.
> > > I hope someone can help, thanks in advance
0
Utf
3/14/2008 11:50:00 AM
(You may get this twice as the server broke as I posted last time)
You did miss the 'can grow' part.  I have 3 boxes; Description,Qty,Price.  
Description will grow but Qty and Price won't.  I want Qty and Price boxes to 
always be same height as Description.
Should be easy I thought, some days the obvious isn't so obvious though.
Hope you can help, thanks for your time so far.

"Stockwell43" wrote:

> Annie,
> 
> If all you're looking to do is place a border around the field so when 
> veiwing the report the data shows in a black box go into the properties of 
> that text box and change the border width from Hairline to 1pt. or however 
> thick you want it. I also explained how to get them all the same size so you 
> should be good to go unless I am not getting what your asking for.
> 
> "AnnieJ" wrote:
> 
> > I have tried this before from another post of yours but have had no luck, I 
> > have tried it again but still not working.  What do you mean by "You need to 
> > use the Line method of your report to draw the rectangles around your 
> > controls.".  Do you mean draw 4 lines around my text boxes to make a 
> > rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
> > sure.
> > 
> > "Duane Hookom" wrote:
> > 
> > > You need to use the Line method of your report to draw the rectangles around 
> > > your controls. Remove the borders of all text boxes and set their Tag 
> > > property to "Border". Then add code to the On Print event of the section 
> > > containing the can grow controls.
> > > 
> > > 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
> > > -- 
> > > Duane Hookom
> > > Microsoft Access MVP
> > > 
> > > 
> > > "AnnieJ" wrote:
> > > 
> > > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > > height and can grow, I want to put a solid box around each but I want them 
> > > > all to default to the tallest so as they look uniform when printed.
> > > > I have spent a long time looking at other posts and trying some OnPrint 
> > > > event procedures but with no luck so far.
> > > > I hope someone can help, thanks in advance
0
Utf
3/14/2008 1:20:03 PM
Yes, I did miss that I apologize for not being more attenative. I guess you 
would use the code Duane is giving you. He has helped me out a lot and is 
very knowledgable.

Open your report in design view I believe he means on each field go into the 
properties and make sure your border style is transparent and border width is 
hairline. Then scroll down to the Tag Property and type in Border. As for the 
code, when you are looking at your report in design view, you should have the 
standard Page Header, Detail, Page Footer and Report Footer provided you 
didn't add any groups. Let's say your field that is set to "Can Grow" is in 
the Detail section. Right click on the detail bar to open it's properties and 
you will see the On Print event. Click on the drop down and select Event 
Procedure, then click on the three dots to the right. Your vba code window 
should open and that's where you want to place your code.

"AnnieJ" wrote:

> (You may get this twice as the server broke as I posted last time)
> You did miss the 'can grow' part.  I have 3 boxes; Description,Qty,Price.  
> Description will grow but Qty and Price won't.  I want Qty and Price boxes to 
> always be same height as Description.
> Should be easy I thought, some days the obvious isn't so obvious though.
> Hope you can help, thanks for your time so far.
> 
> "Stockwell43" wrote:
> 
> > Annie,
> > 
> > If all you're looking to do is place a border around the field so when 
> > veiwing the report the data shows in a black box go into the properties of 
> > that text box and change the border width from Hairline to 1pt. or however 
> > thick you want it. I also explained how to get them all the same size so you 
> > should be good to go unless I am not getting what your asking for.
> > 
> > "AnnieJ" wrote:
> > 
> > > I have tried this before from another post of yours but have had no luck, I 
> > > have tried it again but still not working.  What do you mean by "You need to 
> > > use the Line method of your report to draw the rectangles around your 
> > > controls.".  Do you mean draw 4 lines around my text boxes to make a 
> > > rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
> > > sure.
> > > 
> > > "Duane Hookom" wrote:
> > > 
> > > > You need to use the Line method of your report to draw the rectangles around 
> > > > your controls. Remove the borders of all text boxes and set their Tag 
> > > > property to "Border". Then add code to the On Print event of the section 
> > > > containing the can grow controls.
> > > > 
> > > > 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
> > > > -- 
> > > > Duane Hookom
> > > > Microsoft Access MVP
> > > > 
> > > > 
> > > > "AnnieJ" wrote:
> > > > 
> > > > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > > > height and can grow, I want to put a solid box around each but I want them 
> > > > > all to default to the tallest so as they look uniform when printed.
> > > > > I have spent a long time looking at other posts and trying some OnPrint 
> > > > > event procedures but with no luck so far.
> > > > > I hope someone can help, thanks in advance
0
Utf
3/14/2008 1:46:02 PM
I think I see what is happening.
Annie, you have used the Properties box (or the formatting toolbar) for your
text toxes to make their BorderStyle Solid. You want the controls
(textboxes) to grow together so that the *effect* is 3 black boxes of equal
height with the correct writing in each.

Duane's suggestion will give this effect. Set the BorderStyle for each box
back to Transparant. With the  Properties box open, click on each textbox,
click on the 'Other' tab in the Properties box and next to where it says Tag
type the word Border. Duanes code looks at all the controls in your report's
section and draws a box around any which have the word Border written in the
Tag section.

The bit of his code which says

'Draw a box around each control in Detail _
that has a tag property of "Border"

doesn't mean that you have to physically draw the boxes. It's a comment line
(that's why it starts with a '). It's put there to show you what that bit of
the Code is doing.

The code is put into a code page which (in Design View) you open by right
clicking on the grey bar above the section which contains the controls.
Click on Properties.
Click on the Events tab
Next to OnPrint choose Event Procedures. Open a Code page, Delete the lines
below 'Option Compare Database' which appear there automatically, and paste
in Duane's code (use his original posting so you don't have to delete >>>'s)

You'll see that any line which begins with a ' will be green in the code
window. It's not actually part of the code, it's there just to tell you what
is happening in the code.

When Duane says 'Use the Line method' he's referring to the bit of his code
that says
Me.Line
That's the bit which draws the boxes.

Do try it, it I'm sure it will work. If it doesn't tell us which line it
gets stuck on.

Evi



"AnnieJ" <AnnieJ@discussions.microsoft.com> wrote in message
news:F99C5C30-56A5-45EF-AF04-35062D045C8A@microsoft.com...
> (You may get this twice as the server broke as I posted last time)
> You did miss the 'can grow' part.  I have 3 boxes; Description,Qty,Price.
> Description will grow but Qty and Price won't.  I want Qty and Price boxes
to
> always be same height as Description.
> Should be easy I thought, some days the obvious isn't so obvious though.
> Hope you can help, thanks for your time so far.
>
> "Stockwell43" wrote:
>
> > Annie,
> >
> > If all you're looking to do is place a border around the field so when
> > veiwing the report the data shows in a black box go into the properties
of
> > that text box and change the border width from Hairline to 1pt. or
however
> > thick you want it. I also explained how to get them all the same size so
you
> > should be good to go unless I am not getting what your asking for.
> >
> > "AnnieJ" wrote:
> >
> > > I have tried this before from another post of yours but have had no
luck, I
> > > have tried it again but still not working.  What do you mean by "You
need to
> > > use the Line method of your report to draw the rectangles around your
> > > controls.".  Do you mean draw 4 lines around my text boxes to make a
> > > rectangle?  and how do I "remove the borders"?  the rest I have got
right I'm
> > > sure.
> > >
> > > "Duane Hookom" wrote:
> > >
> > > > You need to use the Line method of your report to draw the
rectangles around
> > > > your controls. Remove the borders of all text boxes and set their
Tag
> > > > property to "Border". Then add code to the On Print event of the
section
> > > > containing the can grow controls.
> > > >
> > > > 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
> > > > --
> > > > Duane Hookom
> > > > Microsoft Access MVP
> > > >
> > > >
> > > > "AnnieJ" wrote:
> > > >
> > > > > I have 3 seperate text boxes that are side by side on a report,
they vary in
> > > > > height and can grow, I want to put a solid box around each but I
want them
> > > > > all to default to the tallest so as they look uniform when
printed.
> > > > > I have spent a long time looking at other posts and trying some
OnPrint
> > > > > event procedures but with no luck so far.
> > > > > I hope someone can help, thanks in advance


0
Evi
3/14/2008 2:12:09 PM
Stockwell43,
Thanks for further explaining how to implement the code. 

AnnieJ,
You can set the properties of several controls at the same time by selecting 
them all then entering the values. For instance click the first text box then 
hold down the shift key and click other text boxes to select. You can then 
view the properties and set the Tag to "Border" and border to transparent.

-- 
Duane Hookom
Microsoft Access MVP


"Stockwell43" wrote:

> Yes, I did miss that I apologize for not being more attenative. I guess you 
> would use the code Duane is giving you. He has helped me out a lot and is 
> very knowledgable.
> 
> Open your report in design view I believe he means on each field go into the 
> properties and make sure your border style is transparent and border width is 
> hairline. Then scroll down to the Tag Property and type in Border. As for the 
> code, when you are looking at your report in design view, you should have the 
> standard Page Header, Detail, Page Footer and Report Footer provided you 
> didn't add any groups. Let's say your field that is set to "Can Grow" is in 
> the Detail section. Right click on the detail bar to open it's properties and 
> you will see the On Print event. Click on the drop down and select Event 
> Procedure, then click on the three dots to the right. Your vba code window 
> should open and that's where you want to place your code.
> 
> "AnnieJ" wrote:
> 
> > (You may get this twice as the server broke as I posted last time)
> > You did miss the 'can grow' part.  I have 3 boxes; Description,Qty,Price.  
> > Description will grow but Qty and Price won't.  I want Qty and Price boxes to 
> > always be same height as Description.
> > Should be easy I thought, some days the obvious isn't so obvious though.
> > Hope you can help, thanks for your time so far.
> > 
> > "Stockwell43" wrote:
> > 
> > > Annie,
> > > 
> > > If all you're looking to do is place a border around the field so when 
> > > veiwing the report the data shows in a black box go into the properties of 
> > > that text box and change the border width from Hairline to 1pt. or however 
> > > thick you want it. I also explained how to get them all the same size so you 
> > > should be good to go unless I am not getting what your asking for.
> > > 
> > > "AnnieJ" wrote:
> > > 
> > > > I have tried this before from another post of yours but have had no luck, I 
> > > > have tried it again but still not working.  What do you mean by "You need to 
> > > > use the Line method of your report to draw the rectangles around your 
> > > > controls.".  Do you mean draw 4 lines around my text boxes to make a 
> > > > rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
> > > > sure.
> > > > 
> > > > "Duane Hookom" wrote:
> > > > 
> > > > > You need to use the Line method of your report to draw the rectangles around 
> > > > > your controls. Remove the borders of all text boxes and set their Tag 
> > > > > property to "Border". Then add code to the On Print event of the section 
> > > > > containing the can grow controls.
> > > > > 
> > > > > 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
> > > > > -- 
> > > > > Duane Hookom
> > > > > Microsoft Access MVP
> > > > > 
> > > > > 
> > > > > "AnnieJ" wrote:
> > > > > 
> > > > > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > > > > height and can grow, I want to put a solid box around each but I want them 
> > > > > > all to default to the tallest so as they look uniform when printed.
> > > > > > I have spent a long time looking at other posts and trying some OnPrint 
> > > > > > event procedures but with no luck so far.
> > > > > > I hope someone can help, thanks in advance
0
Utf
3/14/2008 3:03:00 PM
Duane,
Your code works great. Just one thing. Is there a way to increase the size 
of the line ?

Thanks.
John G

"Duane Hookom" wrote:

> You need to use the Line method of your report to draw the rectangles around 
> your controls. Remove the borders of all text boxes and set their Tag 
> property to "Border". Then add code to the On Print event of the section 
> containing the can grow controls.
> 
> 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
> -- 
> Duane Hookom
> Microsoft Access MVP
> 
> 
> "AnnieJ" wrote:
> 
> > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > height and can grow, I want to put a solid box around each but I want them 
> > all to default to the tallest so as they look uniform when printed.
> > I have spent a long time looking at other posts and trying some OnPrint 
> > event procedures but with no luck so far.
> > I hope someone can help, thanks in advance
0
Utf
3/15/2008 5:12:00 AM
You can add a line of code to set the DrawWidth prior to looping through the 
controls to draw the rectangles.

Me.DrawWidth = 6  'play with this number
-- 
Duane Hookom
Microsoft Access MVP


"John G" wrote:

> Duane,
> Your code works great. Just one thing. Is there a way to increase the size 
> of the line ?
> 
> Thanks.
> John G
> 
> "Duane Hookom" wrote:
> 
> > You need to use the Line method of your report to draw the rectangles around 
> > your controls. Remove the borders of all text boxes and set their Tag 
> > property to "Border". Then add code to the On Print event of the section 
> > containing the can grow controls.
> > 
> > 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
> > -- 
> > Duane Hookom
> > Microsoft Access MVP
> > 
> > 
> > "AnnieJ" wrote:
> > 
> > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > height and can grow, I want to put a solid box around each but I want them 
> > > all to default to the tallest so as they look uniform when printed.
> > > I have spent a long time looking at other posts and trying some OnPrint 
> > > event procedures but with no luck so far.
> > > I hope someone can help, thanks in advance
0
Utf
3/15/2008 5:22:00 AM
Thank you so much Duane that was exactly what I needed.
John G

"Duane Hookom" wrote:

> You can add a line of code to set the DrawWidth prior to looping through the 
> controls to draw the rectangles.
> 
> Me.DrawWidth = 6  'play with this number
> -- 
> Duane Hookom
> Microsoft Access MVP
> 
> 
> "John G" wrote:
> 
> > Duane,
> > Your code works great. Just one thing. Is there a way to increase the size 
> > of the line ?
> > 
> > Thanks.
> > John G
> > 
> > "Duane Hookom" wrote:
> > 
> > > You need to use the Line method of your report to draw the rectangles around 
> > > your controls. Remove the borders of all text boxes and set their Tag 
> > > property to "Border". Then add code to the On Print event of the section 
> > > containing the can grow controls.
> > > 
> > > 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
> > > -- 
> > > Duane Hookom
> > > Microsoft Access MVP
> > > 
> > > 
> > > "AnnieJ" wrote:
> > > 
> > > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > > height and can grow, I want to put a solid box around each but I want them 
> > > > all to default to the tallest so as they look uniform when printed.
> > > > I have spent a long time looking at other posts and trying some OnPrint 
> > > > event procedures but with no luck so far.
> > > > I hope someone can help, thanks in advance
0
Utf
3/15/2008 6:06:00 AM
Yes, I had done all that. 
It did dawn on me that I did something else very stupid/simple though, when 
your original email said to type "Border" in to the Tag box that is what I 
did.  What I should have done was typed Border without the quotes.  Now it 
works perfectly as it should have done before.  Sorry and thanks alot.

"Duane Hookom" wrote:

> Stockwell43,
> Thanks for further explaining how to implement the code. 
> 
> AnnieJ,
> You can set the properties of several controls at the same time by selecting 
> them all then entering the values. For instance click the first text box then 
> hold down the shift key and click other text boxes to select. You can then 
> view the properties and set the Tag to "Border" and border to transparent.
> 
> -- 
> Duane Hookom
> Microsoft Access MVP
> 
> 
> "Stockwell43" wrote:
> 
> > Yes, I did miss that I apologize for not being more attenative. I guess you 
> > would use the code Duane is giving you. He has helped me out a lot and is 
> > very knowledgable.
> > 
> > Open your report in design view I believe he means on each field go into the 
> > properties and make sure your border style is transparent and border width is 
> > hairline. Then scroll down to the Tag Property and type in Border. As for the 
> > code, when you are looking at your report in design view, you should have the 
> > standard Page Header, Detail, Page Footer and Report Footer provided you 
> > didn't add any groups. Let's say your field that is set to "Can Grow" is in 
> > the Detail section. Right click on the detail bar to open it's properties and 
> > you will see the On Print event. Click on the drop down and select Event 
> > Procedure, then click on the three dots to the right. Your vba code window 
> > should open and that's where you want to place your code.
> > 
> > "AnnieJ" wrote:
> > 
> > > (You may get this twice as the server broke as I posted last time)
> > > You did miss the 'can grow' part.  I have 3 boxes; Description,Qty,Price.  
> > > Description will grow but Qty and Price won't.  I want Qty and Price boxes to 
> > > always be same height as Description.
> > > Should be easy I thought, some days the obvious isn't so obvious though.
> > > Hope you can help, thanks for your time so far.
> > > 
> > > "Stockwell43" wrote:
> > > 
> > > > Annie,
> > > > 
> > > > If all you're looking to do is place a border around the field so when 
> > > > veiwing the report the data shows in a black box go into the properties of 
> > > > that text box and change the border width from Hairline to 1pt. or however 
> > > > thick you want it. I also explained how to get them all the same size so you 
> > > > should be good to go unless I am not getting what your asking for.
> > > > 
> > > > "AnnieJ" wrote:
> > > > 
> > > > > I have tried this before from another post of yours but have had no luck, I 
> > > > > have tried it again but still not working.  What do you mean by "You need to 
> > > > > use the Line method of your report to draw the rectangles around your 
> > > > > controls.".  Do you mean draw 4 lines around my text boxes to make a 
> > > > > rectangle?  and how do I "remove the borders"?  the rest I have got right I'm 
> > > > > sure.
> > > > > 
> > > > > "Duane Hookom" wrote:
> > > > > 
> > > > > > You need to use the Line method of your report to draw the rectangles around 
> > > > > > your controls. Remove the borders of all text boxes and set their Tag 
> > > > > > property to "Border". Then add code to the On Print event of the section 
> > > > > > containing the can grow controls.
> > > > > > 
> > > > > > 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
> > > > > > -- 
> > > > > > Duane Hookom
> > > > > > Microsoft Access MVP
> > > > > > 
> > > > > > 
> > > > > > "AnnieJ" wrote:
> > > > > > 
> > > > > > > I have 3 seperate text boxes that are side by side on a report, they vary in 
> > > > > > > height and can grow, I want to put a solid box around each but I want them 
> > > > > > > all to default to the tallest so as they look uniform when printed.
> > > > > > > I have spent a long time looking at other posts and trying some OnPrint 
> > > > > > > event procedures but with no luck so far.
> > > > > > > I hope someone can help, thanks in advance
0
Utf
3/17/2008 8:46:01 AM
Reply:

Similar Artilces:

Exchange rich-text format
What are the results from the client side if I change my Exchange 2003 server to "Alwayes Use" Exchange Rich-Text format from "Determined by individual user settings"? On Thu, 22 Jun 2006 08:31:01 -0700, CK <CK@discussions.microsoft.com> wrote: >What are the results from the client side if I change my Exchange 2003 server >to "Alwayes Use" Exchange Rich-Text format from "Determined by individual >user settings"? Depends on what your users are sending messages as. Most will be using HTML or RTF anyway unless you have some policy in p...

Importing Text File #3
Did ya ever have one of those lucky accidents that you like and would like to replicate? I created a simple excel workbook based on imported text data. Later, when I reopended the file, I noticed that the "refresh" button was activated and would auto import when I clicked. The best part is that the import specs were retained. I have no idea how I did this and have not been able to replicate the functionality. Can someone help? Thanks Bean, It sounds as if you used Data - Get external data. It remembers all the paramaters you specify, and you have only to do a refresh, ...

I have a red pencil box
It's red and holds pencils. ...

Change from MS Outlook Rich Text to HTML
I use Outlook 98 and I want to change my message format to HTML so that I can have nice backgrounds etc on my mail. For some reason this facility doesn't seem to be available to me on the 'Mail Format' Tab. It is blacked out and I cannot change it from Rich Text to HTML. Is there anything I can do to sort this out? Could it be because I am on a network at work and they have disabled it? If so, how can I enable it? Cheers! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www...

Trouble with hyhens within text when using LOOKUP
I have two columns, each containing a list of part numbers. Some of the part numbers contain hyphens. I am using LOOKUP and/or VLOOKUP to determine if the value in one column exists in the other. This works great on non-hyphenated part numbers. However, it will not find or return the hyphenated part numbers from the specified arrays. As a test, I did a quick if statement to compare the instances of identical hyphenated values that exist in both columns. Those statements did not have a problem with the hyphens. Can anyone offer any help? If hyphens cannot be used in conjunction with the ...

instructions disppear when users begin type (text field)
Hi all, I need to customize the outlook contact form and I want to add one text field to allow users to add details info and instruct users how to add. Instructions shows in the field and the instructions disappear when users click and begin to type. How should I do this? exchange 2003/outlook2003 Thank you. It's hard for me to visualize exactly what you're expecting to happen. If you want the instructions to stay on the screen, you could display them in a label control. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumps...

If statement with formatted text
Hi, Is there any way to have an if formula such as: If (A1="Active", "KAE",KPE") where the two letters after the K are formatted as subscript? The best I've done is to paste a picture over the cell. The picture's formula refers to named formula that selects one of two cells, the one with correct string. One cell contains KAE and the other KPE with the subscript. However, it means that I'm using a picture and it would be much nicer if I could just do it in an If formula. I hope that makes some kind of sense, and thanks in advance for your help. D...

Reports and making it look prettier: Last Name, First Name Rank
I'm trying to pretty up my report by eliminating the forced space created by having one field of the report for 'LastName', one for 'FirstName', and one for 'Rank.' The Rank isn't too huge of an issue, and if three items in one field gets to be too much, I have no problem leaving that as a side item of sorts. But, I want my report to look a bit better by putting the names together! I want the report to go to my table, pull the LastName from that column, and pair it with the matching FirstName in the column to the right. (Since it's just...

Inbox and unread box
What's the purpose of having an inbox and an unread box in my outlook 2003. They both read the same number of messages. Is it a duplicate? With Outlook xp, it would simply show a number in black, to let me know the number of unopened messages. Now, there seems to be a separate folder entitled "unread" and it has the exact same number of email messages as my inbox ... all of time, and has always displayed the exact same number since I installed it. Is anyone able to explain this? I dont' understand it. Thanks in advance. Diana Definitely not a duplicate; it's a S...

Saving html message as Draft changes text formatting...
WIN XP HE, OL 2002 Hi, I have recently noticed that whenever I write an email (using Word as editor) in html format, and instead of sending it, save it (to the drafts folder), the text itself changes format from my default to another one. It seems to change in the paragraph style which then changes the text format. The only change I recently made was to edit my signatures in html, rtf and plain text format. When I write a new email, it opens up with the signature already in it and perhaps there are format/style conflicts..? Tx for shedding some light into this. S As an added information, t...

can lookup return cell reference istead of "text" for sumif?
I am trying to use a lookup-function to determine a different sum range for several criteria. Like so: =Sumif($A$7:$A$1447;"<"&X3;vlookup(e3;AT3:AU11;2;false)-Sumif($A$7:$A $1447;"<"&y3;vlookup(e3;AT3:AU11;2;false) The problem is that the vlookup returns text and not the cell reference. Is there a way to get the answer from the lookup expressed as cell reference instead of text, since sumif can't use text, just the cell reference? I use it to calculate the number of hours the staff should be paid, so it's different from weekdays to saturdays, holidays...

Using cell text in a formula
I am trying to use derived cell references in a VLOOKUP formula to matc data in several tables. For example, A1 contains the cell reference fo the top left of my array (A3) whilst cell A2 contains the cel reference for the bottom right of my array (D14). The array I' checking against starts in column E3. However, when I use the formula =VLOOKUP(E3,A1:A2,4,FALSE) I get a #N/ error. I need to use the cell references in each VLOOKUP as the arra sizes may vary in each case. (PS, I've used =INDIRECT(ADDRESS(A1,A2) to derive the cell references. Ji -- Message posted from http://www.Excel...

cannot view all of text in large cell, even though I have it to w.
I have cell format to wrap text and it works fine to a p[oint then no more text is displayed....casn increase the size of the cell, but still only so much will display....rest of the cell show blank. Hi +the limit is 1024 characters. You can extend this with manually inserting linebrekas using aLT+ENTER -- Regards Frank Kabel Frankfurt, Germany sydme wrote: > I have cell format to wrap text and it works fine to a p[oint then no > more text is displayed....casn increase the size of the cell, but > still only so much will display....rest of the cell show blank. ...

Make a cell flash
Please help I to make cell b1 flash when it becomes greater than 5 See: http://www.cpearson.com/excel/BlinkingText.htm -- Gary's Student "Lloyd" wrote: > Please help I to make cell b1 flash when it becomes greater than 5 see response in excel.misc -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Lloyd" <Lloyd@discussions.microsoft.com> wrote in message news:08B5FB85-6AAB-4B7E-ABC1-8CC8E2B61466@microsoft.com... > Please help I to make cell b1 flash when it becomes greater than 5 Thanks for the link. I ...

Making CRM more attractive in Outlook
Hi, I'm new to this site (and MS CRM). I am preparing a presales demo and want to make the outlook (desktop) version of CRM more attractive for users by using the shortcut buttons that CRM provides. I have two questions. One is more Outlook related, really. - Can I create a new view in the navigation pane (like mail, calendar, ...) with my CRM buttons? Right now I have all these buttons under "shortcuts" but that doesn't appeal to the user. - I have once seen a demo where a view was created with all the standard shortcut buttons in a sort of "folder list",...

Text box jumps to left of page
Word 2004 (I am relatively new to Word and am delighted to find a forum specifically for the Mac version. There are a number of unresolved, niggling issues I can live however they slow the workflow. I am eager to learn.) In the recent past, I manually converted 12,000+ recipes from WordPerfect 7 to Word. Since Word 2004 does not have a filter for the old files, the conversion was done on the Windows side of my Mac in Word2003. Those files _usually_ open without protest also in 2004. One annoyance regards text boxes. When text was highlighted and a text box was requested for it in...

How did you add text into publisher, without using boxes?
how do you add text to publisher without using text boxes I suppose you could create your text as an image and insert the image into your publisher file. -- Don Vancouver, USA "Calvin Scott" <Calvin Scott@discussions.microsoft.com> wrote in message news:64D23D52-138D-47B4-B265-4A41BF14BF55@microsoft.com... > how do you add text to publisher without using text boxes Calvin Scott <Calvin Scott@discussions.microsoft.com> was very recently heard to utter: > how do you add text to publisher without using text boxes You don't. Text in Publisher has to e...

List box
I am trying to use the list box function from the control toolbar. I am not sure how to get the listings I want in the list box. Is there certain VB coding that is needed? Any help will be appreciated. Thanks. Todd No VBA code needed. In Design mode, click on your list box and select Properties from the Control toolbox (or right-click your list box and select Properties), then scroll down to the ListFillRange Property and indicate the cell range address that has the items you want to appear in the box (i.e., A1:A10). Then exit out of design mode and test your list box. MRO "Tod...

Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web
Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web Support over 147 countries and ALL languages (unicode encoding) MSG.to provides a unique personal SMS URL for you. It is easy for friends sending text message to you by web. For example, if your name is Lisa, you can register: http://MSG.to/Lisa (you can use this link to see demo) You can also register your mobile phone number as SMS URL like: http://MSG.to/+886913123456 (you can use this link to see demo) Please visit http://msg.to/ for more information. Related keywords: Short Message Serv...

imbed excel cell text in a shape
I need to insert a number into a shape that corresponds to a cell in excel. Kinda like the exploded parts view in a car repair manual. A callout shape with a text value "123" that is linked to cell A1 in file ***.xls. It would be nice to be able to auto generate the callouts from the excel file. shape 123 is cell A1, shape 124 is cell A2 and so on. Thanks what version of visio are you running? al "mystified" <mystified@discussions.microsoft.com> wrote in message news:80B4E390-190A-41D9-AC4A-F96C1DA6FB6E@microsoft.com... >I need to insert a number into a s...

Table headers in a list box (Custom Report)
I have a big table with many fields (more than fifty). They are not in one table but related. Now user's come with a requirement of a separate type of report everyday which has different fields. because of which i have to design a report for them with the required query. I was therefore wondering can i make a form which has two list boxes the one on left side will have all the fields of the table (only headers needed, not data). Users can select multiple no. of fields from that list box which will appear in another list box. Users should be able to then select the order of fi...

Dead Exchange box
I have a SBS 2003 Box that has failed and the owner has no back ups! (Fool) All I have to work with is the new box (Sane Name as the old box) and have managed to retrive the exchange folders from the old srever. Could someone please tell me the best way to get the data back On Wed, 26 Jul 2006 21:49:02 -0700, AndrewS <AndrewS@discussions.microsoft.com> wrote: >I have a SBS 2003 Box that has failed and the owner has no back ups! (Fool) >All I have to work with is the new box (Sane Name as the old box) and have >managed to retrive the exchange folders from the old srever....

How do I use the "Correlation" dialog box with multiple ranges?
I'm using data in an Excel 2003 in a workbook, trying to see if there is any correlation between specific offices in which people work and the length of time they have been employed, their age the amount of sickleave taken and/or the amount of sickleave balance they have. I'm attempting to use Data Analysis and the Correlation dialog box. Although the dialog description tells me that I can use multiple comparison ranges, I don't see how to do it. Thanks for any help. Paulf6 - Arrange your data in list (database) format, i.e., names in the top row (Time Employed, Age, ...)...

Text box unwanted border
For some reason I know not why, that even though I enter 'No line' in both Line/Border style and Dash style I still have a visible bold dash surrounding the text box. Any help would be appreciated. Did you happen to draw a rectangle around the text box? Try highlighting it, and move the bottom text box adjustment up. If the dashed line didn't move, click on it and delete. Or, Copy the text, and paste it and if the dashed line didn't go with the copy, delete the original. -- Don Vancouver, USA "Meridklt" <Meridklt@discussions.microsoft.com> wrote in m...

list box 06-08-07
Hi! I have two list boxes, one shows the list of creditors,"listCred", and the other,"listAR", shows the list of accounts receivable. How can I make the latter list show only the accounts of the creditor that i clicked from the former list? Thanks! -- ai® Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200706/1 Answered in UtterAccess, where you posted the same question. http://www.utteraccess.com/forums/showflat.php?Cat=&Board=83&Number=1431290&Zf=&Zw=&Zg=0&Zl=a&Main=1431285&Search...