S
silvastein
Any thoughts on the following problem?
I LOVE the CanShrinkLines function, which works like a charm until --
it just doesn't. In one DB it is happy as can be, but in another it
will work for a report and then arbitrarily give a #Name? error or ask
for a CanShrinkLines parameter (and then #Error) in my report and
divert to the debugger. I won't have changed a thing on the fields
where it's working when this happens. It appears to single out this
line in the debugger:
If Not IsNull(arrLines(x)) And arrLines(x) <> "" Then
Sometimes giving the message that the line contains no data. For
reference, the Module can be found at
http://office.microsoft.com/en-us/assistance/HA011494721033.aspx and
looks like this:
Public Function CanShrinkLines(ParamArray arrLines())
' Pass this function the lines to be combined
' For example: strAddress =
' CanShrinkLines(Name, Address1, Address2, City, St, Zip)
Dim x As Integer, strLine As String
For x = 0 To UBound(arrLines)
If Not IsNull(arrLines(x)) And arrLines(x) <> "" Then
strLine = strLine & arrLines(x) & vbCrLf
End If
Next
CanShrinkLines = strLine
End Function
Any suggestions would be greatly appreciated.
Many thanks.
JS
I LOVE the CanShrinkLines function, which works like a charm until --
it just doesn't. In one DB it is happy as can be, but in another it
will work for a report and then arbitrarily give a #Name? error or ask
for a CanShrinkLines parameter (and then #Error) in my report and
divert to the debugger. I won't have changed a thing on the fields
where it's working when this happens. It appears to single out this
line in the debugger:
If Not IsNull(arrLines(x)) And arrLines(x) <> "" Then
Sometimes giving the message that the line contains no data. For
reference, the Module can be found at
http://office.microsoft.com/en-us/assistance/HA011494721033.aspx and
looks like this:
Public Function CanShrinkLines(ParamArray arrLines())
' Pass this function the lines to be combined
' For example: strAddress =
' CanShrinkLines(Name, Address1, Address2, City, St, Zip)
Dim x As Integer, strLine As String
For x = 0 To UBound(arrLines)
If Not IsNull(arrLines(x)) And arrLines(x) <> "" Then
strLine = strLine & arrLines(x) & vbCrLf
End If
Next
CanShrinkLines = strLine
End Function
Any suggestions would be greatly appreciated.
Many thanks.
JS