A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Report Layout



 
 
Thread Tools Display Modes
  #1  
Old February 28th, 2007, 07:26 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #2  
Old February 28th, 2007, 08:49 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report Layout

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #3  
Old March 1st, 2007, 02:21 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

Duane,
Thanks for the response. I do want my background colors to grow as well. Is
there a solution for that?

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #4  
Old March 1st, 2007, 02:56 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report Layout

You aren't asking for much ;-)
You can try remove the conditional coloring of backgrounds and use code. I
have modified my code to check a text box named "City" for the value
"London". I want these text boxes to have a background color of pale yellow.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim intMaxHeight As Integer
Dim ctl As Control
Dim lngHilite As Long
lngHilite = 10092543 'pale yellow
'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
'replace conditional formatting making the _
background of City=London pale yellow
If ctl.Name = "City" And ctl.Value = "London" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), lngHilite, BF
End If
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), vbBlack, B

End If
Next
End Sub

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Thanks for the response. I do want my background colors to grow as well. Is
there a solution for that?

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #5  
Old March 1st, 2007, 07:28 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #6  
Old March 1st, 2007, 10:13 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report Layout

Check your code vs mine sample. I copied and pasted directly from my working
sample.

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #7  
Old March 1st, 2007, 11:11 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

This time I copied and pasted...it works flawlessly. Thank you so much.
Apparently, I had my indents wrong.

"Duane Hookom" wrote:

Check your code vs mine sample. I copied and pasted directly from my working
sample.

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #8  
Old March 1st, 2007, 11:13 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

Now, how do I do this for other text boxes? I have more than one "City" that
I need to shade.

"Duane Hookom" wrote:

Check your code vs mine sample. I copied and pasted directly from my working
sample.

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #9  
Old March 2nd, 2007, 02:46 AM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Report Layout

Just add more sections of code like:
If ctl.Name = "City" And ctl.Value = "London" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), lngHilite, BF
End If

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Now, how do I do this for other text boxes? I have more than one "City" that
I need to shade.

"Duane Hookom" wrote:

Check your code vs mine sample. I copied and pasted directly from my working
sample.

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

  #10  
Old March 2nd, 2007, 03:05 PM posted to microsoft.public.access.reports
access freshman
external usenet poster
 
Posts: 14
Default Report Layout

Everything works...you rock. Thanks

"Duane Hookom" wrote:

Just add more sections of code like:
If ctl.Name = "City" And ctl.Value = "London" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), lngHilite, BF
End If

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Now, how do I do this for other text boxes? I have more than one "City" that
I need to shade.

"Duane Hookom" wrote:

Check your code vs mine sample. I copied and pasted directly from my working
sample.

--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

Duane,
Everything is working except the color. When I run the report, the entire
box for "City" shows up black.

"Duane Hookom" wrote:

If you are concerned only about the borders, you can use the line method to
draw all borders based on the height of the tallest text box. This code
assumes each control in your detail section that you want to 'border' has
'Border' in its tag property:
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), , B
End If
Next
End Sub

If you expect background colors of controls to also grow, this solution
won't provide that.
--
Duane Hookom
Microsoft Access MVP


"access freshman" wrote:

I have created a report in MS Access. The report looks much like an excel
spreadsheet. Every text box in the Detail section is set to CanGrow.

My problem is when the largest text box grows the other text boxes in the
same row do not grow to the same size. I cannot just draw lines around the
the text boxes and grow them b/c each text box is conditionally formatted.

How can I set the entire detail section to adjust to the same height
according to the largest text box in the section?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:25 PM.


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