D
DawnTreader
Hello All
i have a form where i have a "shopping cart" that the user has 2 buttons
that cause a quantity of parts to be added to an order. each time they hit
the + button it needs to add a qty of 1 to the table. if there is already 1
of that part in the table it needs to update the table so that there is now 1
more to the current qty, and if the part isnt in the table then it needs to
add the part and give it a qty of 1. the - button on the form is intended to
do the reverse.
currently this is all done directly to the part order line item table, the
problem is that each subsequent hit of the + button adds a new line item, it
isnt looking for the part id to see if it is already there. the other problem
is that the - button doesnt just remove a qty of 1, it wipes out all of the
items in the table.
i am thinking that a temporary table would be a better set up. my idea is to
add all the parts to a table and then when the user hits the "add to cart"
button, an update / append query will add the parts to the proper part order
table. the problem is that i am unsure i can get one query that does both the
append and updating of records. do i need to break this into 2 operations?
is there any examples out there that might help me figure this out?
all and any help is appreciated!
i have a form where i have a "shopping cart" that the user has 2 buttons
that cause a quantity of parts to be added to an order. each time they hit
the + button it needs to add a qty of 1 to the table. if there is already 1
of that part in the table it needs to update the table so that there is now 1
more to the current qty, and if the part isnt in the table then it needs to
add the part and give it a qty of 1. the - button on the form is intended to
do the reverse.
currently this is all done directly to the part order line item table, the
problem is that each subsequent hit of the + button adds a new line item, it
isnt looking for the part id to see if it is already there. the other problem
is that the - button doesnt just remove a qty of 1, it wipes out all of the
items in the table.
i am thinking that a temporary table would be a better set up. my idea is to
add all the parts to a table and then when the user hits the "add to cart"
button, an update / append query will add the parts to the proper part order
table. the problem is that i am unsure i can get one query that does both the
append and updating of records. do i need to break this into 2 operations?
is there any examples out there that might help me figure this out?
all and any help is appreciated!