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

Splitting a Dynamic String

Status
Not open for further replies.

toddsalcedo

Programmer
Jul 2, 2001
49
US
I have a dynamic string (1, 2, 3, 4,) that can contain numerous different numbers (they are ID numbers). I need an easy way to split the string so I can use each number individually to access the database and query for those records. I tried the following but it doesn't work.

id = request.form("id")
Replace(id, "") 'removing spaces
Split(id, ",") ' split at ","

 
Something like this ?
id = Replace(Request.Form("id") , " ", "")
a = Split(id, ",") ' split at ","
For i = 0 To UBound(a)
MsgBox "ID" & i & "=" & a(i)
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top