B
billypit786
List is like this in Listbox(Me.PalletIDOrTrackingNo_ListBox)
LONO----|PalletNo|Description-----------|BatchNO--|CRTN|Pcs|Total|
Remain|Location
->1------|2---------|3---------------------------------|
4---------------|5----|6----|7-----|8------|9--------
->7807 | 21102 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7807 | 21103 | DKNY BE DELICIOUS | 79658BV3 | 30 | 10 | 300 | 300 |
256BB
->7807 | 21104 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7808 | 21105 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
->7808 | 21106 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
->7807 | 21107 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7807 | 21108 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7808 | 21109 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
How can I add selected items from column 8(Remain)?
Like If I select first line then TotalRemain=200
then If I select 2nd line then TotalRemain=200+300=500
then If I select 3rd line then TotalRemain=200+300+200=700
then If I disselect 2nd line then TotalRemain=200+300+200-300=400
I am using this code but its not working properly
For Each var In Me.PalletIDOrTrackingNo_ListBox.ItemsSelected
Me.TotalRemain = Me.TotalReamin +
Me.PalletIDOrTrackingNo_ListBox.Column(8, var)
Next var
using this code things gone like this
Like If I selected first line then TotalRemain=200
then If I select 2nd line then TotalRemain=200+200+300=700 instead of
200+300=500
then If I select 3rd line then TotalRemain=200+200+300+300+200=1200
instead of 200+300+200=700
I don't get it why this is happening but I think its bcz I am using
FOR EACH.
can anyone help me?
LONO----|PalletNo|Description-----------|BatchNO--|CRTN|Pcs|Total|
Remain|Location
->1------|2---------|3---------------------------------|
4---------------|5----|6----|7-----|8------|9--------
->7807 | 21102 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7807 | 21103 | DKNY BE DELICIOUS | 79658BV3 | 30 | 10 | 300 | 300 |
256BB
->7807 | 21104 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7808 | 21105 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
->7808 | 21106 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
->7807 | 21107 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7807 | 21108 | DKNY BE DELICIOUS | 79658BV1 | 20 | 10 | 200 | 200 |
256BA
->7808 | 21109 | DKNY BE DELICIOUS | 79658BV2 | 20 | 10 | 200 | 200 |
256BD
How can I add selected items from column 8(Remain)?
Like If I select first line then TotalRemain=200
then If I select 2nd line then TotalRemain=200+300=500
then If I select 3rd line then TotalRemain=200+300+200=700
then If I disselect 2nd line then TotalRemain=200+300+200-300=400
I am using this code but its not working properly
For Each var In Me.PalletIDOrTrackingNo_ListBox.ItemsSelected
Me.TotalRemain = Me.TotalReamin +
Me.PalletIDOrTrackingNo_ListBox.Column(8, var)
Next var
using this code things gone like this
Like If I selected first line then TotalRemain=200
then If I select 2nd line then TotalRemain=200+200+300=700 instead of
200+300=500
then If I select 3rd line then TotalRemain=200+200+300+300+200=1200
instead of 200+300+200=700
I don't get it why this is happening but I think its bcz I am using
FOR EACH.
can anyone help me?