Hope you can help - I have simple list box which is populated from DB and has 6 columns [ID, name, ordnumber, data, price ,postcode]
The listbox is populated without issues [So for that purposes I will not post the code]
The issue i have is when i'm trying to get the running total of the prices when I select item in list box.
With lstOrdersInBatch
tbxTotal.value = 0
For IntIndex = 0 To .ListCount - 1
If .Selected(IntIndex) Then
'tbxTotal = tbxTotal + .Column(4)
End If
Next
End With
It's giving me incorrect value
I have gone through the debug log and it's seems it only take the last item selected & not all selected.
Hope you can help.
Thanks
Please note is access VBA programming.
===== SOLVED ===
Retrieve column values of the selected row of a multicolumn Access listbox
That has the answer.
With lstOrdersInBatch
tbxTotal.value = 0
For IntIndex = 0 To .ListCount - 1
If .Selected(IntIndex) Then
tbxTotal = tbxTotal + lstOrdersInBatch.Column(4, IntIndex)
End If
Next
End With
Thank you for trying.