Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trim Field Results in Report 1

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
I have a Report, with a Sub_Report.

The Sub_Report is a Continuous Form.

My 'TaskName' lodas into the Sub_Report.

'TaskName' fields are like:
Code:
01. Beginning Balance
02. Received
03. Completed
04. Ending Balance
% Errors

I would like to show only the alphabetical names, not the numbers. HOWEVER, I need to keep the sort order provided by those numbers, so I can't trim it in the query (which also happens to be a crosstab query, making this harder).

I know the syntax to do it in a query:
Code:
=IIf(InStr([TaskName],". ")>0,Trim(Mid([TaskName],InStr([TaskName],".")+1)),[TaskName])

But I don't know how to do it after-the-fact in the report.

Thanks. Sean.
 

If I understand your question correctly, instead of having a bound textbox on your form for TaskName, you need to have an unbound textbox, then simply enter the same code you have above into the unbound textbox.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Blast! I had done that before, but it gave me '#Error' everywhere.

It is working now though, so I must have done something woring!

THanks for the help! Sean.
 
Just figured out why when I did it to another field.

The Control Name was the same as the Field Name (CategoryName and CategoryName).

SO I changed the Control Name to txtCategoryName, problem solved!

Thanks. Sean.
 
Yes, it's one of Access's charming little quirks that naming the control the same as the field may cause random errors like that (yet by default the designer always uses the same name as the field).

 

Sad but true! It creates a circular reference!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top