Discussion Locked
0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have a form for our Intranet that captures and writes information to an Access97 database via a SQL Insert statement. Everything works fine except for the two fields that are populated by drop down lists (which are stored in tables in the same Access database). For every other field multiple values can be entered and they are written to the database correctly, however, from the drop down lists only the first value is written back to the database. How do I get the multiple values in the drop down lists to write to the database correctly? Using an underscore between the values is not an option.
5 replies
by fofa
If you need seperate rows, you will have to loop through and insert for each value, however if you want a string, concantenate the multi-values together in a string.
by kdoyle
The question was auto-closed by TechRepublic
by dan_cohen
Multiple answers on a drop down box are returned as Answer1, Answer2, Answer3 (a comma between each selected option).
On your html form (I am assuming you are using Active Server Pages) you need to use the Split function to parse the multiple answers such as below:
tempstring = Request.Form("YourListBoxName")
tempArray = split(tempstring,",")
For p=0 To UBound(tempArray)
strAnswer = strAnswer & " " & tempArray(p)
Next
You would then write the string strAnswer to the database.
Hope this helps.
by kdoyle
The question was auto-closed by TechRepublic
by kdoyle
This question was auto closed due to inactivity
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending
Discussion Locked
What Makes a Business Website Effective in 2026
2 helpful
10 replies
Question
Windows and macOS computers becoming slow or unstable after updates - what should I check first
0 helpful
1 reply
1 helpful
3 replies
Discussion
Optimizing WordPress widgets and DOM size
0 helpful
3 replies
Discussion Locked
Best Ways to Improve Website Visibility
0 helpful
5 replies