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

Can I bypass "New Line in Field" form control in a Report? 1

Status
Not open for further replies.

Ravensleach

Programmer
Oct 19, 2004
45
PE
I have a single address field, with the data entry form property set to “New Line in Field”.

I need to produce a report including this field in which the address stays on one line. Is there anything I can do, either in the report or in the underlying query, that will achieve this?

Thanks
 
In the format event procedure of the relevant section:
[address text box] = Replace([address field], vbCrLf, " ")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I think you could get the same results without code using a control source of:
=Replace([AddressField],Chr(13)&Chr(10)," ")
Make sure the name of the text box is not the name of a field. Also, this solution might depend on the version of Access.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Thanks guys for responding so quickly.

Using PHV's solution, I get a run-time error 2448 'You can't assign a value to this object'

and using dhookom's, I get a parameter prompt. And when I try to bluff my way past that, I get an very complicated error with the same message. I'm using Access2000 btw.

Any more suggestions .......

 
'You can't assign a value to this object'
Even when using an unbound textbox ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Oops - it's unbound now. And works, even though it seems to need the original text box in the report too to find the field. I can work round that if I have to.

You guys are stars. I go now to Paypal. :)
 
PH's solution does require a text box bound to the field. It could be invisible.

I believe that specific versions of Access 2K don't fully implement the Replace() function in queries and control sources.

Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top