I hope Im being stupid! Here is my problem, I have 2 listboxes, one with all the items that can be selected, and 2 buttons to add or remove these items to the second listbox. This works fine. On form submission all the items in the second listbox should write to the database.
In the submit button click routine I have the following code:
For ItemNo = 0 To lst_AssociatedRushes.Items.Count - 1
add this one - this bit would actually write to a DB
TheValue = lst_AssociatedRushes.Items(ItemNo).Value
Next
(The idea is to change the code inside the "For..Next" loop to wirte the values to a database)
HOWEVER - every time I submit, the first value I get is ALWAYS 0 (zero) - even if I change the order of the list items etc. Ive tried stepping through other listboxes (ie static ones) and the same thing always seems to happen. The 2nd, 3rd etc items always get the correct values. If I change to look at the "text" property (ie TheValue = lst_AssociatedRushes.Items(ItemNo).Text) then the first item has "Nothing" for the text....
Any ideas?
In the submit button click routine I have the following code:
For ItemNo = 0 To lst_AssociatedRushes.Items.Count - 1
add this one - this bit would actually write to a DB
TheValue = lst_AssociatedRushes.Items(ItemNo).Value
Next
(The idea is to change the code inside the "For..Next" loop to wirte the values to a database)
HOWEVER - every time I submit, the first value I get is ALWAYS 0 (zero) - even if I change the order of the list items etc. Ive tried stepping through other listboxes (ie static ones) and the same thing always seems to happen. The 2nd, 3rd etc items always get the correct values. If I change to look at the "text" property (ie TheValue = lst_AssociatedRushes.Items(ItemNo).Text) then the first item has "Nothing" for the text....
Any ideas?