How can I capture the values of a multipe select l

Results 1 to 2 of 2

Thread: How can I capture the values of a multipe select l

  1. #1
    Join Date
    Dec 1969

    Default How can I capture the values of a multipe select l

    Ok... I have this list, where I display a recordset... well, in this list you can select several elements, i mean, it&#039;s a multiple list. The code is like the following: <BR><BR>&#060;select name="cboPuestos" size="5" multiple&#062; <BR>&#060;% <BR>While (NOT Recordset_Puestos.EOF) <BR>%&#062; <BR>&#060;option value="&#060;%=(Recordset_Puestos.Fields.Item("IdP uesto").Value)%&#062;"&#062;&#060;%=(Recordset_Pue stos.Fields.Item("Descripcion").Value)%&#062;&#060 ;/option&#062; <BR>&#060;%Recordset_Puestos.MoveNext() <BR>Wend <BR>If (Recordset_Puestos.CursorType &#062; 0) Then <BR>Recordset_Puestos.MoveFirst <BR>Else <BR>Recordset_Puestos.Requery <BR>End If <BR>%&#062; <BR><BR><BR>Well, a selection in this select-list should return values like: <BR><BR>cboPuestos=1 <BR>cboPuestos=3 <BR>cboPuestos=8 <BR><BR>But, how can I capture thos values to insert them in an access table? <BR><BR>I must insert the returned values from cboPuesto into several records of my table... so, if the forms return the values: <BR><BR>idUser = 3 <BR>cboPuesto = 4 <BR>cboPuesto = 5 <BR>cboPuesto = 8 <BR><BR>In the table named PuestoUser, should be created several records, one per each selection in the cboPuesto select-list, like this: <BR><BR><BR>PuestoUser Table <BR>idUser idPuesto <BR>3 4 <BR>3 5 <BR>3 8 <BR><BR><BR>remember it is a multiple select list, where you can select multiple values.... and THAT is precisely my issue, that I don&#039;t know how the heck I can capture those values and insert them into my table... <BR><BR>Thank you for your help..... <BR><BR>C ya!<BR><BR><BR>__________________<BR>Internet is just the refflection of what is inside your mind &#060;&#062;&#060;<BR>

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category Databases, Queries

    The link to the ASPFAQs is at the top right corner of most every page on this site, including the one you are reading right now.<BR><BR>There an FAQ in that category that is relevant here, but it discusses doing queries with a &#060;SELECT MULTIPLE&#062;, not an insert.<BR><BR>Since you can only do one insert at a time, you&#039;ll have no choice but to do:<BR><BR>&#060;%<BR>...<BR>puestos = Split( Request("cboPuestos"), ", " ) &#039; COMMA-SPACE<BR>For i = 0 TO UBound( puestos )<BR>&nbsp; &nbsp; SQL = "INSERT INTO ... VALUE(" & puestos(i) & ", ...)"<BR>&nbsp; &nbsp; conn.Execute SQL<BR>Next<BR>...<BR>%&#062;<BR><BR>Or something along those lines. Be sure to use COMMA-SPACE to SPLIT with, not just comma.<BR><BR><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