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

Formatting SQL/Access Fields

Status
Not open for further replies.

AndyApp

Programmer
Dec 20, 2001
259
GB
Can anyone tell me if it's possible to pull data from SQL/Access and keep the formatting? For example I have an Access front end that allows people to insert addresses into one of the fields on multiple lines such as:

address 1
address 1,1
address 1,1,1

but when I get the data it just all comes out on one line:

address 1 address 1,1 address 1,1,1

I need it as it is in the database. "Life is like a Ferrari, it goes to fast.
But that's ok, because you can't afford it anyway" - Jim Davis (Garfield)
 
when you read the data from the database use the following:
Code:
strAddress = Replace(objRecordset(&quot;Address&quot;),vbcrlf,&quot;<BR>&quot;)

This will replace the linebreaks in the database with valid HTML linebreaks Tony
reddot.gif WIDTH=400 HEIGHT=2 VSPACE=3

 
You could also wrap your text in the <pre></pre> tag.

Thanks,

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top