K
ken
I have a text box (txtLegalName) on an 800 page report that
concatenates some information together. I am setting the value of the
text box (which includes the concatenation) on the print event of the
detail section. Originally, I had it in the underlying query of the
report but the report took forever to run. It now runs much faster as
the concatenation happens as each page prints instead of for each
record of all 800 pages before the report opens.
Here is the problem. The Can Grow property does not work on
txtLegalName in this instance so the concatenated string gets cut off
in some cases. I have Can Grow set on both txtLegalName and the Detail
section itself. I don't want to increase the height of the text box
and turn Can Grow off as this will add unnecessary white space to the
report. I know the dynamic setting of the value of the text box in the
Print event is the problem because removing the concatenation allows
Can Grow to work properly.
Here is what I have in the Detail Print event:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim qdf As QueryDef
Dim strSql As String
'further filter the subquery before concatenating.
Set qdf = CurrentDb.QueryDefs("qryCoFundsWithoutCount")
strSql = Trim(qdf.SQL)
qdf.SQL = Left(qdf.SQL, (Len(qdf.SQL) - 3)) & " AND
qryRsTblCo.fldCoID=" & Me.fldCoID
'set the string that will populate the text box
strFunds = Me.[fldCoName] & IIf(IsNull(Me.[fldCoTaxType]) = False,
_
" (" & Me.[fldCoTaxType] & ") ", "") & " - " &
ConcatenateChar("qryCoFundsWithoutCount", "fldFundID", "[fldCoID] = "
& _
Me.fldCoID, "", "/ ")
'populate the text box
Me.txtLegalName = strFunds
'reset the querydef
qdf.SQL = strSql
Set qdf = Nothing
End Sub
Any ideas on how to make txtLegalName grow to the proper height with
the Print Event set as it currently is? I'm trying to speed up the
printing of this report and everything works fine except that this
text box is not growing as it should.
Thanks-
Ken
concatenates some information together. I am setting the value of the
text box (which includes the concatenation) on the print event of the
detail section. Originally, I had it in the underlying query of the
report but the report took forever to run. It now runs much faster as
the concatenation happens as each page prints instead of for each
record of all 800 pages before the report opens.
Here is the problem. The Can Grow property does not work on
txtLegalName in this instance so the concatenated string gets cut off
in some cases. I have Can Grow set on both txtLegalName and the Detail
section itself. I don't want to increase the height of the text box
and turn Can Grow off as this will add unnecessary white space to the
report. I know the dynamic setting of the value of the text box in the
Print event is the problem because removing the concatenation allows
Can Grow to work properly.
Here is what I have in the Detail Print event:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim qdf As QueryDef
Dim strSql As String
'further filter the subquery before concatenating.
Set qdf = CurrentDb.QueryDefs("qryCoFundsWithoutCount")
strSql = Trim(qdf.SQL)
qdf.SQL = Left(qdf.SQL, (Len(qdf.SQL) - 3)) & " AND
qryRsTblCo.fldCoID=" & Me.fldCoID
'set the string that will populate the text box
strFunds = Me.[fldCoName] & IIf(IsNull(Me.[fldCoTaxType]) = False,
_
" (" & Me.[fldCoTaxType] & ") ", "") & " - " &
ConcatenateChar("qryCoFundsWithoutCount", "fldFundID", "[fldCoID] = "
& _
Me.fldCoID, "", "/ ")
'populate the text box
Me.txtLegalName = strFunds
'reset the querydef
qdf.SQL = strSql
Set qdf = Nothing
End Sub
Any ideas on how to make txtLegalName grow to the proper height with
the Print Event set as it currently is? I'm trying to speed up the
printing of this report and everything works fine except that this
text box is not growing as it should.
Thanks-
Ken