P
prairiewind via AccessMonster.com
I've posted my problem in the Reports/Printing section of the forum, but
after some time it seems like it is a VBA issue. I am using VBA to populate
5 text boxes in my report. (The text boxes are one below the other.) My
problem is when record A has 2 lines of data (only txtLine1 & txtLine2), then
record B will only show 2 lines even if it has 3 (txtLine3 has data that
doesn't show.). Then if record C has 2 lines of data, there will be a blank
line being that record B had 3 lines. It seems to take the conditions of the
previous record and apply it to the current record.
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 NOT be
there.
I'll include the coding that I have for behind the On Print property of the
detail section of the report. As you'll see, what goes in txtLine1, txtLine2,
etc. is dependent on what information and how much information is in two
different fields.
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.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
What is causing the detail section of the report to not grow/shrink as
desired.? If I make the text box overly large and set the Can Shrink
property to No, then everything shows, but that leaves a lot of blank space
as well.
I am using Access 2007 on Windows XP.
Thanks,
Jeffrey
after some time it seems like it is a VBA issue. I am using VBA to populate
5 text boxes in my report. (The text boxes are one below the other.) My
problem is when record A has 2 lines of data (only txtLine1 & txtLine2), then
record B will only show 2 lines even if it has 3 (txtLine3 has data that
doesn't show.). Then if record C has 2 lines of data, there will be a blank
line being that record B had 3 lines. It seems to take the conditions of the
previous record and apply it to the current record.
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 NOT be
there.
I'll include the coding that I have for behind the On Print property of the
detail section of the report. As you'll see, what goes in txtLine1, txtLine2,
etc. is dependent on what information and how much information is in two
different fields.
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.txtLine1 = Me.Lastname & ", " & Me.FirstnameMe.NameLineLength Then
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
What is causing the detail section of the report to not grow/shrink as
desired.? If I make the text box overly large and set the Can Shrink
property to No, then everything shows, but that leaves a lot of blank space
as well.
I am using Access 2007 on Windows XP.
Thanks,
Jeffrey