Combo List Box Help Needed

Results 1 to 2 of 2

Thread: Combo List Box Help Needed

  1. #1
    JvG Guest

    Default Combo List Box Help Needed

    I&#039ve read a bunch of tutorials explaining how to retrieve multiple data using a combo list box, but I&#039ve seen none explaining the procedure how to enter multiple data values into one.<BR><BR>I&#039m sure this has an easy solution, but I&#039m hardly a coding god <BR>and I&#039ve spent half a day on this with no working solution in sight.<BR><BR>Anyway, the (simplified) situation is this. I have the following<BR>tables in access:<BR><BR>ITEMS <BR>ItemID Description<BR>1 Blah<BR>2 Blah<BR><BR>ITEMS_CAT<BR>ItemID CatID<BR>1 1<BR>1 3<BR>2 2<BR>2 3<BR><BR>CAT<BR>CatID Category<BR>1 category 1<BR>2 category 2<BR>3 category 3<BR><BR>I have two editable fields, one for the item descriptions, while the<BR>ITEMS_CAT table is updated with a combo list box, which holds<BR>all of the categories applicable to each item.<BR><BR>Suppose now that I would want to update item1, assigning it to<BR>all 3 categories.<BR><BR>My first stumbling block is the SQL statement<BR><BR>SQL="Update ITEMS, ITEMS_CAT SET Description =&#039" & form_name & "&#039," <BR>SQL=SQL & "ITEMS_CAT.CatID=&#039" & form_cat & "&#039,"<BR>SQL=SQL & "ITEMS_CAT.ItemID=&#039" & form_ID & "&#039,"<BR>SQL=SQL & " WHERE ITEMS_CAT.ItemID=" & form_ID & " AND ITEMS.ItemID=" & <BR>form_id <BR>Set RS = Conn.Execute(SQL)<BR><BR>Now, this works fine when just updating/selecting a single category value for <BR>an item, but I can&#039t get it to insert new values for an item when any are <BR>added to the category selection. I can see that the form_cat variable needs to<BR>be split, but I tried that and it won&#039t work, reporting a data mismatch error <BR>of some sort.<BR><BR>form_cat=request.form("form_cat")<BR> arrForm_cat = Split(form_cat, ", ", -1, 0)<BR><BR>Even if I can split the variable into an array, I&#039m still very doubtful that <BR>the SQL statement would add new values properly.<BR><BR>Can anyone offer any useful insights here?

  2. #2
    jason Guest

    Default RE: Combo List Box Help Needed

    there&#039s a tutorial on this in the ASP section of - entitled something like &#039dealing with multiple selects&#039 - it doens&#039t go into great depth, but tells you how it&#039s done<BR><BR>jason

Posting Permissions

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