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!

String Manipulation 1

Status
Not open for further replies.

BenUK

Technical User
Oct 30, 2001
58
US
I have a string which is in the following format;

"1,450,2,300,3,450,4,50"

The string is created through a custom VB function and populates a query. I have managed to manipulate the string on a report via another custom VB function so it then looks like this;

"Code1 450 Code2 300 Code3 450 Code4 50"

However I want each code to be on a separate line - so it appears like this:

Code1 450
Code2 300
Code3 450
Code4 50

This is where I get stuck - has anyone any ideas?

(I don't think I can force the values through a number of text boxes as the number of codes could change...)

Thanks
Ben
 
Not 100% sure what you want, but if it is to display
the codes on individual lines in a textbox on a form
or report, then in your splitting code, add a vbCrLf
to the split line after each code is added to the
variable, e.g.:

vCodes = vCodes & lstrCode & vbCrLf

Reply if you still have problems

Regards...
 
Sweet - Exactly what I was after! I never new about vbCrLf???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top