Listview selection then edit selection

Hello Forum,

I am slightly stuck on something and I am hoping I can get some guidance on how to overcome this.

I collect data in various fields and this is stored in tinydb as tag “collected”. To view the records, I have a list view the retrieves the records and displays perfectly. I can also remove items from the list and all this works fine.
I have a cumbersome way of editing records which is in another virtual screen and more chicks than I would like, although the functionality works.

I am trying to combine my edit function with my listview. On listview record select I have a notifier, delete or edit, (Delete works) edit takes me to my virtual edit screen. My challenge is to “carry” the item I selected in the listview over to the virtual edit screen to then retrieve the associated data aloowing me to make some edits. I have a save function in place.

I am getting stuck at the index, the value at index 13 is a unique barcode. I am unsure how to retrieve this from the listview on selection, perhaps this isn’t the best way to solve the puzzle? My IF element is a hash up.

Any constructive guidance would be greatly appreciated.

Hi GC1 :wink:

What is in your lvAssetData list ? Is it the barcode numbers? Should you be getting .Selection as opposed to .SelectionIndex ? If so, then you can test "global test2" against item value index 13...

At present, you are trying to compare chalk and cheese (an index with a value)

Hi TIMAI2 :wave:

Not exclusively barcode numbers, there is other data in there too.

I am kind of following although need to join this together, "Selection Returns the text in the ListView at the position of SelectionIndex"

last step to PROD :slight_smile:

Ah OK, so both your lvAssetData list and global collectedAssets lists come from the same data in tinydb "collected". In which case their indexes should align....therefore you should not need to find a match for the barcode, just use the .SelectionIndex from lvAssetData to select the sublist from global collectedAssets and then dish the values out to textboxes.

Something like this:


:boom: Thanks TIMAI2 :boom:

All working now :ok_hand:

Well done :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.