Detail showing wrong number of lines

  • Thread starter prairiewind via AccessMonster.com
  • Start date
P

prairiewind via AccessMonster.com

In my report, each detail has between 2 and 5 lines. However, the detail
will only show the number of lines as the previous detail has. For example:

Detail A has 2 lines but shows none. (Will show one line if I put the "Can
Shrink" to No on detail and text box.)
Detail B has 3 lines, but only shows 2.
Detail C has 5 lines, but only shows 3.
Detail D has 2 lines, but shows 5. (3 blank lines.)

The code behind this is in On Print. If the code is needed, I'll place it on
here, but thought if there was something obvious that I'm doing wrong that I
would start with that.

I'm running Access 2007 on Windows XP.

Thanks,
Jeffrey
 
P

prairiewind via AccessMonster.com

I forgot to include in the original post that the "Can grow" with both the
detail section and text boxes is set at "Yes." The problem isn't growing or
shrinking, rather it isn't growing and shrinking with the appropriate detail.

Thanks,
Jeffrey

KARL said:
Try setting "Can Grow" to "Yes".
In my report, each detail has between 2 and 5 lines. However, the detail
will only show the number of lines as the previous detail has. For example:
[quoted text clipped - 13 lines]
Thanks,
Jeffrey
 
K

KARL DEWEY

In my report, each detail has between 2 and 5 lines.
Do you mean lines of text or actual records?

If you are talking about records the "Can grow" has nothing to do with it.
I would suspect a filter set in the report or some report object overlapping
the area needed to expand.

Examine the records it does pull to see if there is a pattern to indicate a
filter. Add phony record that fits the patern to see if it will also show.

prairiewind via AccessMonster.com said:
I forgot to include in the original post that the "Can grow" with both the
detail section and text boxes is set at "Yes." The problem isn't growing or
shrinking, rather it isn't growing and shrinking with the appropriate detail.

Thanks,
Jeffrey

KARL said:
Try setting "Can Grow" to "Yes".
In my report, each detail has between 2 and 5 lines. However, the detail
will only show the number of lines as the previous detail has. For example:
[quoted text clipped - 13 lines]
Thanks,
Jeffrey
 
P

prairiewind via AccessMonster.com

In my original post, I should have used "Record" instead of "Detail."

The problem still seems to be that the detail section is not growing or
shrinking properly. I can make the text box to be larger than needed and set
the "Can Grow" and "Can Shrink" property of both the text box and detail
section to "No." This allows the data to be displayed in its entirety.
However, there is a lot of white space between the records that is undesired.


When I set the "Can Shrink" property of the text box and detail section to
"Yes" then a maximum of 3 lines for each record is printed even if there are
more. If there are less, the third line is then blank. The first record of
the report only shows up as blank lines.

If I set the "Can Shrink" property of the text box and the detail section to
"No" and the "Can Grow" property of the text box and detail section to "Yes",
it is again the same situation as when all the properties are set as "No."

I also should have included in the original report that there are two text
boxes side by side that can vary in the amount of lines it prints for each
record. Maybe this is the problem?

Thanks,
Jeffrey


KARL said:
Do you mean lines of text or actual records?

If you are talking about records the "Can grow" has nothing to do with it.
I would suspect a filter set in the report or some report object overlapping
the area needed to expand.

Examine the records it does pull to see if there is a pattern to indicate a
filter. Add phony record that fits the patern to see if it will also show.
I forgot to include in the original post that the "Can grow" with both the
detail section and text boxes is set at "Yes." The problem isn't growing or
[quoted text clipped - 10 lines]
 
K

KARL DEWEY

The side by side can be a problem. It is best to somehow figure out how to
shuffle the text boxes around so that any that are to shrink or grow are not
side by side.
After that I suggest to resize the text box to one line height and reduce
the detail accordingly. Set the 'Can Grow' of both text box and detail to
Yes.

prairiewind via AccessMonster.com said:
In my original post, I should have used "Record" instead of "Detail."

The problem still seems to be that the detail section is not growing or
shrinking properly. I can make the text box to be larger than needed and set
the "Can Grow" and "Can Shrink" property of both the text box and detail
section to "No." This allows the data to be displayed in its entirety.
However, there is a lot of white space between the records that is undesired.


When I set the "Can Shrink" property of the text box and detail section to
"Yes" then a maximum of 3 lines for each record is printed even if there are
more. If there are less, the third line is then blank. The first record of
the report only shows up as blank lines.

If I set the "Can Shrink" property of the text box and the detail section to
"No" and the "Can Grow" property of the text box and detail section to "Yes",
it is again the same situation as when all the properties are set as "No."

I also should have included in the original report that there are two text
boxes side by side that can vary in the amount of lines it prints for each
record. Maybe this is the problem?

Thanks,
Jeffrey


KARL said:
In my report, each detail has between 2 and 5 lines.
Do you mean lines of text or actual records?

If you are talking about records the "Can grow" has nothing to do with it.
I would suspect a filter set in the report or some report object overlapping
the area needed to expand.

Examine the records it does pull to see if there is a pattern to indicate a
filter. Add phony record that fits the patern to see if it will also show.
I forgot to include in the original post that the "Can grow" with both the
detail section and text boxes is set at "Yes." The problem isn't growing or
[quoted text clipped - 10 lines]
Thanks,
Jeffrey
 
P

prairiewind via AccessMonster.com

I've reworked the coding that fills the text boxes which has helped a couple
of issues. I've also eliminated some of the text boxes so that there is only
one column of text boxes that can grow/shrink. However the original issue
still is there, where is record A has 2 lines of data, then record B will
only show 2 lines even if it has 3. (Each line of data is in its own text
box.) Then if record C has 2 lines of data, there will be a blank line being
that record B had 3 lines.

For example:
Record A:
Tom Sawyer
123 Main St, Anytown, AA 12345

Record B:
Huck Fynn
Property Managment
(234 Side St, Here, BB 23456) - this line doesn't show

Record C:
Willow Switch
345 Boxcar Ave, There, CC 34567
This is a blank line that should be there.


Will keep working on things here and if there are more ideas/suggestions, I'd
be happy to here.

Thanks,
Jeffrey

KARL said:
The side by side can be a problem. It is best to somehow figure out how to
shuffle the text boxes around so that any that are to shrink or grow are not
side by side.
After that I suggest to resize the text box to one line height and reduce
the detail accordingly. Set the 'Can Grow' of both text box and detail to
Yes.
In my original post, I should have used "Record" instead of "Detail."
[quoted text clipped - 35 lines]
 
P

prairiewind via AccessMonster.com

I mistyped. In Record C, the blank line should read:
This is a blank line that should NOT be there.

Thanks, Jeffrey
I've reworked the coding that fills the text boxes which has helped a couple
of issues. I've also eliminated some of the text boxes so that there is only
one column of text boxes that can grow/shrink. However the original issue
still is there, where is record A has 2 lines of data, then record B will
only show 2 lines even if it has 3. (Each line of data is in its own text
box.) Then if record C has 2 lines of data, there will be a blank line being
that record B had 3 lines.

For example:
Record A:
Tom Sawyer
123 Main St, Anytown, AA 12345

Record B:
Huck Fynn
Property Managment
(234 Side St, Here, BB 23456) - this line doesn't show

Record C:
Willow Switch
345 Boxcar Ave, There, CC 34567
This is a blank line that should be there.

Will keep working on things here and if there are more ideas/suggestions, I'd
be happy to here.

Thanks,
Jeffrey
The side by side can be a problem. It is best to somehow figure out how to
shuffle the text boxes around so that any that are to shrink or grow are not
[quoted text clipped - 8 lines]
 
K

KARL DEWEY

(Each line of data is in its own text box.)
Whoa!! How are you doing that?
You should have a query pulling records from your table.
The record source for the report should be the query.
The control source for the text box should a field from the query.

How are you getting data from the table to the text boxes?

prairiewind via AccessMonster.com said:
I mistyped. In Record C, the blank line should read:
This is a blank line that should NOT be there.

Thanks, Jeffrey
I've reworked the coding that fills the text boxes which has helped a couple
of issues. I've also eliminated some of the text boxes so that there is only
one column of text boxes that can grow/shrink. However the original issue
still is there, where is record A has 2 lines of data, then record B will
only show 2 lines even if it has 3. (Each line of data is in its own text
box.) Then if record C has 2 lines of data, there will be a blank line being
that record B had 3 lines.

For example:
Record A:
Tom Sawyer
123 Main St, Anytown, AA 12345

Record B:
Huck Fynn
Property Managment
(234 Side St, Here, BB 23456) - this line doesn't show

Record C:
Willow Switch
345 Boxcar Ave, There, CC 34567
This is a blank line that should be there.

Will keep working on things here and if there are more ideas/suggestions, I'd
be happy to here.

Thanks,
Jeffrey
The side by side can be a problem. It is best to somehow figure out how to
shuffle the text boxes around so that any that are to shrink or grow are not
[quoted text clipped - 8 lines]
Thanks,
Jeffrey
 
P

prairiewind via AccessMonster.com

The data for the report is taken from a query. The record source for the
report is the query. In the report there are hidden text boxes, one for each
item in the query. I have 5 unbound text boxes (txtLine1, txtLine2, etc.)
that I wish to conditionally fill depending on what data exists for each
records. (I think this is where I got you confused, sorry about that.) Here
is the coding behind the scenes:

If IsNull(Me.Children & Me.ExtraAddressInformation) Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname
Me.txtLine2 = Me.FullAddress1
Me.txtLine3 = Me.FullAddress2
ElseIf IsNull(Me.Children) And Len(Me.ExtraAddressInformation) > 1 Then
If Len(Me.Lastname & Me.Firstname & Me.ExtraAddressInformation) > Me.
NameLineLength Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname
Me.txtLine2 = Me.ExtraAddressInformation
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & " " & Me.
ExtraAddressInformation
Me.txtLine2 = Me.FullAddress1
Me.txtLine3 = Me.FullAddress2
End If
ElseIf Len(Me.Children) > 1 And IsNull(Me.ExtraAddressInformation) Then
If Len(Me.Lastname & Me.Firstname & Me.Children) > Me.NameLineLength Then
If Len(Me.Children) > Me.NameLineLength Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.
SplitChildrenLeft
Me.txtLine2 = Me.SplitChildrenRight
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname
Me.txtLine2 = Me.Children
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
End If
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.Children
Me.txtLine2 = Me.FullAddress1
Me.txtLine3 = Me.FullAddress2
End If
ElseIf Len(Me.Children) > 1 And Len(Me.ExtraAddressInformation) > 1 Then
If Len(Me.Lastname & Me.Firstname & Me.Children) > Me.NameLineLength Then
If Len(Me.Children) > Me.NameLineLength Then
If Len(Me.Lastname & Me.Firstname & Me.ExtraAddressInformation) >
Me.NameLineLength Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.
SplitChildrenLeft
Me.txtLine2 = Me.SplitChildrenRight
Me.txtLine3 = Me.ExtraAddressInformation
Me.txtLine4 = Me.FullAddress1
Me.txtLine5 = Me.FullAddress2
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.
SplitChildrenLeft
Me.txtLine2 = Me.SplitChildrenRight
Me.txtLine3 = Me.ExtraAddressInformation
Me.txtLine4 = Me.FullAddress1
Me.txtLine5 = Me.FullAddress2
End If
Else
If Len(Me.Lastname & Me.Firstname & Me.ExtraAddressInformation) >
Me.NameLineLength Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname
Me.txtLine2 = Me.Children
Me.txtLine3 = Me.ExtraAddressInformation
Me.txtLine4 = Me.FullAddress1
Me.txtLine5 = Me.FullAddress2
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & " " & Me.
ExtraAddressInformation
Me.txtLine2 = Me.Children
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
End If
End If
Else
If Len(Me.Lastname & Me.Firstname & Me.ExtraAddressInformation) > Me.
NameLineLength Then
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.
Children
Me.txtLine2 = Me.ExtraAddressInformation
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
Else
Me.txtLine1 = Me.Lastname & ", " & Me.Firstname & "; " & Me.
Children
Me.txtLine2 = Me.ExtraAddressInformation
Me.txtLine3 = Me.FullAddress1
Me.txtLine4 = Me.FullAddress2
End If
End If
End If


Thanks for your patience and help in all of this. This may be a VBA issue
now more than a report issue

Jeffrey

KARL said:
Whoa!! How are you doing that?
You should have a query pulling records from your table.
The record source for the report should be the query.
The control source for the text box should a field from the query.

How are you getting data from the table to the text boxes?
I mistyped. In Record C, the blank line should read:
This is a blank line that should NOT be there.
[quoted text clipped - 35 lines]
 
K

KARL DEWEY

I do not know why you need the coding.
I am assuming that all name and address fields are in the same record.
It seems like what you need for the text box is this --
[Lastname] & ", " & [Firstname] & Chr(13) & Chr(10) & IIF([Children] Is
Null, "", [Children] & Chr(13) & Chr(10) & IIF([ExtraAddressInformation] Is
Null, "", [ExtraAddressInformation] & Chr(13) & Chr(10) & [FullAddress1] &
Chr(13) & Chr(10) & [FullAddress2]
 
D

Douglas J. Steele

You don't even need that. You can take advantage of the fact that +
propagates Nulls, while & doesn't when used as a concatenation character.

[Lastname] & ", " & [Firstname] & (Chr(13) & Chr(10) + [Children]) &
(Chr(13) & Chr(10) + [ExtraAddressInformation]) & (Chr(13) & Chr(10) +
[FullAddress1]) & (Chr(13) & Chr(10) + [FullAddress2])
 
P

prairiewind via AccessMonster.com

The reason I need the coding is because what goes in the first line is
conditional as to what fields the record has and how much data is in the
field. The code suggested is fine if the first line always and only has the
first and last name, the second line always on only has children, etc.
However, that is not what I'm wanting. You'll notice in the coding that I
posted, that there are several different options as to what goes in the first
line, the second line, etc.

Thanks for the hint about the + instead of the &. I'll keep working on this
end and thanks for all your help.

Jeffrey
You don't even need that. You can take advantage of the fact that +
propagates Nulls, while & doesn't when used as a concatenation character.

[Lastname] & ", " & [Firstname] & (Chr(13) & Chr(10) + [Children]) &
(Chr(13) & Chr(10) + [ExtraAddressInformation]) & (Chr(13) & Chr(10) +
[FullAddress1]) & (Chr(13) & Chr(10) + [FullAddress2])
I do not know why you need the coding.
I am assuming that all name and address fields are in the same record.
[quoted text clipped - 4 lines]
Null, "", [ExtraAddressInformation] & Chr(13) & Chr(10) & [FullAddress1] &
Chr(13) & Chr(10) & [FullAddress2]
 
P

prairiewind via AccessMonster.com

When I enter the code suggested in a text box, all the data is printed.
However, part of the reason for doing the code as I have it is so that the
all but the first line is indented and to condense the report. Coding as you
suggested will allow things to grow and shrink as needed so my conclusion is
that there is something in the code that is causing things to act goofy. I
might pose my problem in the VBA section of the forum.

Thanks,
Jeffrey

KARL said:
I do not know why you need the coding.
I am assuming that all name and address fields are in the same record.
It seems like what you need for the text box is this --
[Lastname] & ", " & [Firstname] & Chr(13) & Chr(10) & IIF([Children] Is
Null, "", [Children] & Chr(13) & Chr(10) & IIF([ExtraAddressInformation] Is
Null, "", [ExtraAddressInformation] & Chr(13) & Chr(10) & [FullAddress1] &
Chr(13) & Chr(10) & [FullAddress2]
 
P

prairiewind via AccessMonster.com

The solution was to put the code behind the OnFormat rather than behind the
OnPrint.

Thanks,
Jeffrey
When I enter the code suggested in a text box, all the data is printed.
However, part of the reason for doing the code as I have it is so that the
all but the first line is indented and to condense the report. Coding as you
suggested will allow things to grow and shrink as needed so my conclusion is
that there is something in the code that is causing things to act goofy. I
might pose my problem in the VBA section of the forum.

Thanks,
Jeffrey
I do not know why you need the coding.
I am assuming that all name and address fields are in the same record.
[quoted text clipped - 3 lines]
Null, "", [ExtraAddressInformation] & Chr(13) & Chr(10) & [FullAddress1] &
Chr(13) & Chr(10) & [FullAddress2]
 
K

KARL DEWEY

You can indent by putting Space(5) & in front of the rest of the
concatenated string. Use what ever number you wish for indentation.

prairiewind via AccessMonster.com said:
When I enter the code suggested in a text box, all the data is printed.
However, part of the reason for doing the code as I have it is so that the
all but the first line is indented and to condense the report. Coding as you
suggested will allow things to grow and shrink as needed so my conclusion is
that there is something in the code that is causing things to act goofy. I
might pose my problem in the VBA section of the forum.

Thanks,
Jeffrey

KARL said:
I do not know why you need the coding.
I am assuming that all name and address fields are in the same record.
It seems like what you need for the text box is this --
[Lastname] & ", " & [Firstname] & Chr(13) & Chr(10) & IIF([Children] Is
Null, "", [Children] & Chr(13) & Chr(10) & IIF([ExtraAddressInformation] Is
Null, "", [ExtraAddressInformation] & Chr(13) & Chr(10) & [FullAddress1] &
Chr(13) & Chr(10) & [FullAddress2]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top