Need advice on best way to do this

H

HSalim

Hello All:
I have been mulling over the best way to approach this task. I want to vet
my ideas, so all comments and suggestions are welcome.

Here is the scenario:
Consider an order with multiple items
Row Item Qtty Carton
1 123 5 1
2 345 5 1

We start with the assumption that all 8 items are to be packed into the same
carton.

The task is to give the user the ability to change the packing to look like
this:
Row Item Qtty Carton
1 123 2 1
2 345 2 1
1.1 123 2 2
2.1 345 2 2
1.2 123 1 3
2.2 345 1 3

I was thinking of building the logic as follows:

PseudoCode
insert into copyRS select * from boundtable where x,y,z

on exit or lost Focus event of Qtty
select sum(qtty) from where int(row) = int(me.row)
if sum(qtty) > CopyRS.Qtty then error (and more logic to handle error)

if sum(qtty) < copyRS.Qtty then
add new row for this item; row = row +.1; qtty = CopyRS.Qtty - sum(qtty) ;
carton = carton + 1

I thought of using OldValue. It would work if the user proceeded in a
linear fashion and never went back to edit a previous record - otherwise it
could be a problem.

Am I making sense? Any suggestions?
Regards
Habib
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top