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!

Format Strings

Status
Not open for further replies.

glove

Technical User
Aug 24, 2000
42
US
If I have a table with a field containing a string such as "Test1;Test2;Test3", is there a way to pull the values from that string, perhaps using the MID function, and display them in a report as:

Test1
Test2
Test3

Any suggestion would be appreciated. Thanks.

[sig][/sig]
 
Try this:

Dim OldString as String
Dim NewString as String

OldString = "Test1;Test2;Test3"

NewString = Replace(OldString, ";", vbCrLf)

This will replace the semicolon with the carriage return/line feed character.

Steve
[sig][/sig]
 
Thanks for the reply Steve. The codes works fine, but why can't I use the function "replace" in a query or report? I get an error that says it is an unknown function. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top