Can't Write A Loop

Results 1 to 3 of 3

Thread: Can't Write A Loop

  1. #1
    Join Date
    Dec 1969

    Default Can't Write A Loop

    I have a list box containing user names. The user can select multiple persons for the list box. On the next page I need to write a loop that will add a new record to a table that will contain the selected's name and record number. I can't store them all together as one record so I need to write a loop to add a new record to the database for each person selected. The problem is that I don't know how really. Thanks

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default Use the array

    If your list box is named mylistbox, then it's going to be posted to the next page (assuming you're using method=post on your form) as an array named mylistbox. Loop through all elements within mylistbox... mylistbox(0) through mylistbox(n) where n is last element and insert your records by using the mylistbox(x).value.

  3. #3
    Join Date
    Dec 1969

    Default RE: Can't Write A Loop

    For Each field in Request.Form<BR>Response.Write field & " = " & Request.Form(field)<BR>Next<BR><BR>in short:<BR>For Each element in collection<BR>...<BR>Next<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts