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

How can i do this?

Status
Not open for further replies.

gmagerr

Technical User
Aug 11, 2001
323
US
hi, i have a form that will update a database. it's basically a form of parts. the field i want to update in the database is called Quantity. i have around 10 items on my form, and for each item there is a text box called Quantity. When i view the form in internet explorer, and add enter numbers in the quantity box and hit submit, i get an error saying Access Driver Error Duplicate output destination. any ideas on how to do this correctly. all i want to do is put whatever i enter into the text boxes into the quantity field of the database, based on the productID.. thanks in advance.
 
it's a bit hard to say from that vague error message, but have you named 10 different form fields the same name(quantity) by any chance?

if not, or maybe if so you should try response.write - ing the sql you're using to enter the quantities in the database - this should show you what's wrong. It might, for eample, be trying to add two items into the same field or trying to add something that violates an isunique constraint.

 
I've just realised that if you're using a for each loop, you're probably trying to insert into several fields called quantity in the same insert statement. You need to do a separate insert for each quantity / prodid pair.

Try renaming the form fields to include a number (quantity1, quantity2 etc.) and then looping through them with

for i = 1 to 10
if request(&quot;quantity&quot; & i ) <> &quot;&quot; then
....sql insert statement involving request(&quot;prodid&quot; & i) and request.(&quot;Quantity&quot;&i)
end if
next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top