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
1942 Views

Similar Articles

[PageSpeed] 0

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:

Autofit Row Height #3
Hello, I have a column on sheet 1 that is set to wrap text so that the row height increases and decreases as more text is entered into the cell. This works fine. Users enter a number on sheet two where there is a lookup function that returns the appropriate text from sheet 1. The problem is that when the text is returned by the function, the row height does not adjust to fully display all of the text in the cell. Is there a way of automating this? Any help would be appreciated. -- Thanks, MarkN ...

Max Limit for Values in List Boxes and Combo Boxes in Outlook forms
Folks, a user is setting up a form. She wants to have several combo boxes and list boxes with between 75 and 300 (yes, 300 -- that's not a typo!) possible values in the combo box or list box. Before she starts work on this, she would like to know if there is a limit on the number of possible values for a combo box or a multi-select list box. Is there a limit? Is it defined by the number of characters in the values box, or the number of actual values? What is the limit? Any help here would be appreciated. Thanks. David consulttech2004@hotmail.com ...

How do I create a bulleted list text format inside cell?
I am collecting data and want to format the text inside the "notes" (my title) cell so that it can be more easily read. I would like to make a bulleted list. There are several cells that need this formatting. Is this possible? There is no help for this. You have to do it manually. -- Regards, Tom Ogilvy "DEH" <DEH@discussions.microsoft.com> wrote in message news:DFAEE5CC-0AAD-41D7-9DE1-396187DA2681@microsoft.com... > I am collecting data and want to format the text inside the "notes" (my > title) cell so that it can be more easily read. I would...

anyway to make outlook to execute some vbs or js script for complex filtering
or would I have to make use of .net? at this place there is no .net implemented Maybe the outlook vba group might be a better place to post "MSDN newsgroup" <NoOne@allMailSunken.net> wrote in message news:%23Mp53SYEKHA.4184@TK2MSFTNGP02.phx.gbl... > or would I have to make use of .net? > > at this place there is no .net implemented > "MSDN newsgroup" <NoOne@allMailSunken.net> wrote in message news:%23Mp53SYEKHA.4184@TK2MSFTNGP02.phx.gbl... > or would I have to make use of .net? > > at this place there is no .net implemented mic...

Excel should default to autoformat for chart text boxes
Excel in (Office 2003 and as far as I can tell all previous versions of Excel) should default to autoformat for chart text boxes - it currently selects "none" for outline and background options ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.micr...

how do I increase drop list font and box size I created
Font is small and you have to scroll through list due to box size If the dropdown was created using Data Validation.............Font size is set at 8pt Dropdown box height cannot be changed. For workarounds like using a ComboBox and using Zoom see Debra Dalgleish's site on DV Lists. http://www.contextures.on.ca/tiptech.html Gord Dibben MS Excel MVP On Fri, 4 Apr 2008 11:36:02 -0700, cdietz1 <cdietz1@discussions.microsoft.com> wrote: >Font is small and you have to scroll through list due to box size ...

Find feature does not work with HTML messages (Content-type: text/html)
I have Outlook 2000 SP-3 running under Windows ME. When using the Find feature to locate all e-mails with a given word in the message, no items are found if the e-mails are of "text/html" content-type. The Find feature appears to work for any messages that have URLs embedded and are "multipart/alternative" or "text/plain" content-type. I noticed a similar post several months ago (see http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=%23qSBYIssDHA.2224%40TK2MSFTNGP09.phx.gbl). Is there a work-around for this problem, or should this be reported t...

Help with Combo-box
Hey everyone, hopefully someone's run across a problem similar to this and their is a (simple :) solution). Basically I have a simple combo-box that is displayed in a dialog. Now, the problem is that I have around 7200 entries that I want to appear in that box as valid selections...well thus far I haven't been able to get that many entries as a possibility (the combo-box simply refuses to allow me to enter that many fields of data). :( Okay, I tried googling this (thought maybe there was a readily defined maximum on combo-box data size) but I couldn't find anything that wou...

pre-select new record in combo box
Hi, I have a form (frmActivity) with a combo box (cboStore) that gets its data from a table (Store). If there is a new store which dose not show in the combo box I have a command button on the same form that open a popup window for entering the name of the new store. In the 'on close' event of the popup I requeary the combo box (cboStore) on the main form so that the new store will appear. What I would really like is to have the new store already selected in the combo box when the popup is closed. Is this possible and if so how? Thanks, Phil Try after the requery of the ...

How to make Unique coloumn in Excel sheet ?
I want to make one coloumn in excel sheet as unique, so no entry is repeated in that particular column. See http://www.contextures.com/xlDataVal07.html on this. HTH. Best wishes Harald "V JHANJI" <V JHANJI@discussions.microsoft.com> skrev i melding news:5D9465E8-EE69-4D59-8BD7-B0115D09145C@microsoft.com... > I want to make one coloumn in excel sheet as unique, so no entry is repeated > in that particular column. Hi check out http://www.cpearson.com/excel/NoDupEntry.htm for detailed instructions on how to do this. Cheers JulieD "V JHANJI" <V JHANJI...

Need help extracting text from EDLs
I really am trying to learn this stuff, but I haven't programmed anything since my TRS-80 Basic days and I'm a bit overwhelmed. I want to extract text from Edit Decision Lists so that I have a list of shots used in a film. Here is an example of one event of an EDL: 002 TAPE004 V C 04:45:22:06 04:45:24:14 02:00:08:00 02:00:10:08 FROM CLIP NAME: 7C-4_B_ DLEDL: PATH: /raids/luc_1/bun/reel_02/oscans/1222/bun_7c_4_b_02/2048x1556/ The text that follows "FROM CLIP NAME:" is the name of the clip that I want to extract so that I have a document on onl...

Lost ability in MSWord to make ANY changes to ANY document
Somehow when I open a document in Word, it will not let me do anything other than open the document, print and close, everything else come up 'faded'- I can't even make changes anymore, and i've tried restoring my system to an earlier date, but nothing- Version of Word? If it's 2007 and someplace on the screen it says something about "This modification is not allowed because selection is locked", it could be that you've been using a trial version that's now expired or you haven't properly activated your full version. -- Cheers! Gor...

Automatically display set text based on users composition
Hi, im trying to do something really simple, trouble is i dont know what the feature's called to be able to search for tips on how to do it. Basically in outlook messages, when a user begins writing a sentence e.g. "in the terms of" i need a tag to pop up that allows the user to press enter and then the remainder of what they will want to type in will be inserted in, its a yellow tag that comes up above the words. i dont know where it needs to be created and enabled. Cheers, Rhys. ...

Make your site eazy to use.
A year or two ago I use to be able to get on CustomerSource very eazily and get information and articles I needed. Now it took me 15 minutes just to sign on. Then I could not find an article about opening a new year or closing 2005. How simple should something that basic be? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreade...

Creating an AD account don't make the mailbox in exch2K3
Hi, I don't understand what's happening. When I create a new account in AD, it no longer creates the mailboxes in exchange 2003. It was working a week ago... It asks me if I also want to create a mailbox, I answer YES and ... no mailbox. Please help me, I must create this mailbox quickly since a new employee arrived and my boss doesn't understand why the mail is not set yet. I believe that the mailbox is actually created only after the first message is sent to it or there is a first logon. So if you are looking for it and you do not see it, this may be the cause. Frank &qu...

Outlook 2003: Cursor automatically in To box when
Whenever I create a new message; reply to one; or forward one in Outlook 2003 on a machine I inherited from someone else at work, the blinking text cursor is automatically placed in the To box. I've never seen this happen before in Outlook or any other email app and its quite annoying. I end up having to either retype the beginning of my message again in the body of the email or cut and paste what i've already began to type. Please help, DMarrs@biziteks.com On Wed, 28 Jul 2004 14:16:12 -0700, <DMarrs@biziteks.com> wrote: >Whenever I create a new message; reply to one...

Moving comment box leader arrow head
Can I move the position of the head of a comment arrow from one corner of the cell it references to another corner? When I display the comment box/arrow for printing it looks as if it is refering to the cell on the right, since the comment arrow points to the upper-right corner of the cell, instead of the upper-left. Francisco ...

Outlook Client on CRM 1.2 Server Box for Demos
Hi, Did a CRM 1.2 install on Windows 2003 Server and all is working well. I have been seeing things on this newsgroup that say I should be able to install the Outlook client as well on this machine although it is an unsupported configuration. This is for demo's only. I am running it under Virtual PC. I would like to not have to have 2 Virtual PC images running just to show the Outlook integration to CRM. When I try to install the Outlook client I get a message at the start saying that the Outlook client is already installed. It is not. Suggestions anyone? Alan ...

Text-To-Columns Fixed Width
When using Text-To-Columns, Excel "recognizes" that the data fits the Fixed Width criteria and PRE-assigns the width. In most of the cases I work with Excel is wrong 99% of the time. Is there a way to force Excel to NOT pre-assign the width (leave everything blank)? On the first panel of the wizard click Delimited, then on the second panel click space as the delimiter. Hope this helps. Pete On Feb 4, 12:50=A0am, TP <T...@discussions.microsoft.com> wrote: > When using Text-To-Columns, Excel "recognizes" that the data fits the Fix= ed > Width ...

Code to send SMS text message?
Hi, I would like to send an SMS text message to a cel phone via code within Excel 2007. Has anyone done this? What code / services / products do I need to accomplish this? Does anyone have an example? Thanks in advance. --Dan What gateway are you using? What you would need to do is to snd a internet message to a gateway provider which would then send the messae out on the wireless land. Most likely you are using a webpage interface from your PC to interface with the gateway. So opening up an internet explorer and goiong to an URL is probably the method to use. ...

Access 2007 Rich Text Question 04-28-07
Hi All In the plan text version of a Memo field you can easily add a date by pressing Ctrl+Colon which makes life easy for the end user. However, if the Memo field is set to the Rich Text Property this no longer works. Or am I missing something? Tom gave me a part answer last week but I cannot see a way of inserting a date on a Rich Text Memo field by using keystrokes Thanks ...

Text box and formatting?
I am working on class schedule and have one text box which spans a few pages. Pages are double columns. I have a header for each class and paragraph given for class description. On the last page, last column, one description appears at the top with empty space for the rest of the column. I would like to change the formatting of the text in the whole text-box so that most of the last column is used. I can select the text in the text box which expands over the few pages and play with the font size, but that would mean that all the text would be the same size. Is there a way that text...

How do I use text in a cell as a range name in a formula
If cell A1 had the text TEST in it and TEST is the name I have given to a group of cells using the name box what formula can I use to give me the sum of TEST, thats is the sum of the cells in the group called TEST. I understand that I can simply have =SUM(TEST), but I want the formula to refer to Cell A1 to get the name ie =SUM(A1) doesn't work obviously Any help appreciated Thank you In this case, you want to use the INDIRECT function. E.g., =SUM(INDIRECT(A1)) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Kiwi" &...

How to reopen and make changes to a closed contract
I have been reading the blog from ms dynamics team about opening and changing a closed appointment: http://blogs.msdn.com/crm/archive/2007/03/08/how-to-reopen-a-closed-appointment-and-make-changes-to-the-file.aspx I'm trying to do the same thing with a contract. the code I used is almost the same. I changed "Appointment" with "Contract" and the state and state Reason: state code : ' <ContractState>Active</ContractState>'+ state Reason: ' <ContractStatus>3</ContractStatus>'+ see also http://msdn2.microsoft.com/en-us/library/a...

How do I make the toolbar in my 'trial' of Publisher 2007 work?
nothing is active except the select all button. i can't edit or create anything. not making me want to buy the full version. thanks to anyone who has any ideas. j jives wrote: > nothing is active except the select all button. i can't edit or create > anything. not making me want to buy the full version. > thanks to anyone who has any ideas. > > j ======================= Maybe the tutorials at the following site will get you started: Publisher 2007 Creating a publication http://tinyurl.com/32ew4l -- John Inzer MS Picture It! - Digital Image MVP D...