Solved Listbox data not displaying when adding items to a destination Listbox (1 Viewer)

Hi. The actual application scans in a book. The new book is in the first position. Then I want to put that book details in the destination list. The next book we scan which will be a different book is also in the first position then we add that book to the destination list. So we build a list of books captured. I hope you understand. I will not ask something to waste your time. All I need know is to have the books that gets captured to appear in the first position of our destination list. You can add a extra button to just to remove the first element form the search list and in order to have different data in the destination list every time. Thanks
Why not just add the scanned books to the seond listbox directly?
I *thought* you wanted just one entry in the destination as you clear the value list each time?
Now you say you want to add more than one to the second list box? If so @MajP has already given you code to do that. Basically save what is already there before adding another entry.
 
Last edited:
Why not just add the scanned books to the seond listbox directly?
I *thought* you wanted just one entry in teh detsination as you clear the value list each time?
Now you say you want to add more than one to the second list box? If so @MajP has already given you code to do that. Basically save what is already there before adding another entry.
No, the destination list does not get cleared. I will only clear it when I scan in a new set of books. The destination list combines all the single list of books scanned. Everything works correctly. All I need now is the last entry must appear first in the destination list. This might not make sense to you sorry, but this is what I need for my book scanning application. I hope anybody can come up with some solution please. Thanks

Really? That seems useless.
 
I hope anybody can come up with some solution please.
Still do not understand, but I demoed that already using the index argument of the additem method to put the added item at the top of the list.
 
Do you want to add the first item from the source to the destination.
Then remove the first item from the source list
Then select the new first item to add
Then remove the new first item.
....
Each time putting the added item at the top.
 
New best guess.
It pulls the first item off the top list and moves to the second list by marking it processed. The moved item always appears at top of list.
 

Attachments

Thanks to all your solutions. I have finally solve that puzzle of putting it into first position.
1734797620051.png
 
So let me explain what happening here. I scan the book in via a book code. The book codes picks up the details of the book which is displayed in our search box(Listbox with bold font) which is automatically move the record to the destination list box(below the scroll bar) in the first position. So I can see which was the last book brought in and who the learner was. Thanks for all your help. I hope you all have a Blessed Christmas with your family.🎄🎄🎄(y)
(Now how am I going to change the -1 to yes ).
 
No idea TBH? :(
You could convert any Boolean to Yes or No in your code?

But why not put scanned books into a scan table and then just use that as your source, sorted by descending time record inserted. That could be done as you have now with an Insert query, or just scan to that listbox in the first place?
 
No idea TBH? :(
You could convert any Boolean to Yes or No in your code?

But why not put scanned books into a scan table and then just use that as your source, sorted by descending time record inserted. That could be done as you have now with an Insert query, or just scan to that listbox in the first place?
Hi. Gasman good morning. I have tried that and order the query by date/time. Scanning list box is filled with a query ordered by date/time descending order. But for some reason the last item did not always go to the top. That is why I had to try an alternative method. Thanks
 
Hi. Gasman good morning. I have tried that and order the query by date/time. Scanning list box is filled with a query ordered by date/time descending order. But for some reason the last item did not always go to the top. That is why I had to try an alternative method. Thanks
So you are getting bad data in? I'd suggest looking at what is causing that. If it is messing with the date/time of your check in, it may be causing other issues you haven't found yet.

Coding to avoid this problem doesn't mean it isn't a problem. It also may be the kind of issue that causes the current "Fix" provided to no longer work.
 
Hi. Gasman good morning. I have tried that and order the query by date/time. Scanning list box is filled with a query ordered by date/time descending order. But for some reason the last item did not always go to the top. That is why I had to try an alternative method. Thanks
I would have to ask, why do you want the order opposite to how the books were scanned in?
 

Users who are viewing this thread

Back
Top Bottom