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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force a line-break in Axis String for Chart 1

Status
Not open for further replies.

BMeek

Programmer
Sep 18, 2000
70
US
Hello my friends! I need some help with a chart report I am using in Access 2000. The SQL behind the chart uses the following string:

Z: "Next"+Space(1)+Format([subchrtCoopPercAvgVolPerAgent].[ProdAgents],"#,###")+Space(1)+"Agents /"+Space(1)+Format([subchrtCoopPercAvgVolPerAgent].[PercAgents],"#%")+Space(1)+"of Active Agents"

My challenge is to force a line-break after "Agents /" so the axis values are equally distributed and the line-breaks where I want instead of where ever it defaults.

The way the axis line looks now is:

Next 128 Agents / 1% of Active
Agents

The way I want it to look is:

Next 128 Agents /
1% of Active Agents

I have tried +chr(17); and all I get is a little box where the line-break is suposed to happen. Any suggestions?

Bryan Meek
bmeek@adelphia.net
 
You should be able to use Chr(13) & Chr(10) to force the line break like this

Z: "Next"+Space(1)+Format([subchrtCoopPercAvgVolPerAgent].[ProdAgents],"#,###")+Space(1)+"Agents /" & Chr(13) & Chr(10) & "+Space(1)+Format([subchrtCoopPercAvgVolPerAgent].[PercAgents],"#%")+Space(1)+"of Active Agents"


Paul
 
Thanks Paul,
Aside from an extra " in the middle of the string, it worked fine.

Thanks again!

Bryan Meek
bmeek@adelphia.net
 
I probably put that extra " in by accident when I tested the string. Glad it worked.

Paul
 
Paul,

This is a late post, but thanks for that easy solution to putting line breaks!

I tried the same thing but with "vbCRLF" insteaod of the Chr function... any idea why the textbox didn't like using the Constant variable name?

Earnie Eng
 
Basically it has to do with the scope of the Constant. vbCRLF is a Visual Basic for Applications(VBA) constant and it's scope is within the scope of a VBA procedure. Chr() is an Access built in Function and it's scope extends beyond to confines of a VBA module. For example, it can be read by an Access query. That's about the best I can explain it. Maybe someone can add a little more to this.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top