Hi, I know this is going to be easy (for some!) but I just can't sort it out. (Edited...please see foot of post in case there are others who are having a similar issue)
I have two listboxes. Listbox 1 gets data from an access db (no probs, works as it should) and the other uses the selected item from listbox 1 to populate listbox 2. Problem is, when I change the selection in listbox 1, the (correct) items are returned to listbox 2 but the previous selection remains.
Example: at the moment there are just 3 records in the DB - don't want to complicate things! The records are: starname ... constell
em cyg ... cyg
ss cyg ... cyg
gt ori ... ori
The values in "constell" appear in listbox 1, so if I click on "Ori" then "gt ori" dutifully appears alone in listbox 2 (since it's the only 'ori' in the DB). If I now click on "Cyg" in listbox 1, the two records returned also appear as they should in listbox 2 BUT "gt ori" is still there. I want previous results to go away when a different item is selected in listbox 1. Everything works fine database-wise but the problem is with the listboxes (specifically listbox 2).
Many thanks and a happy 2018 to all you nice helpful folks wherever you are.
*OK - sorted it out, I think. I was still thinking 'VB6' and listbox.clear wasn't there. It's listbox.items.clear(). So no need to reply! Off-topic Closing Point!
Is there any way for the forum software to NOT attach tags to messages? Often I get messages saying the post failed due to too many tags, but I didn't put them there! The software seems to pick out many completely pointless, random words from a post and turn them into tags! For instance, this post 'created' the words dutifully and folks among the hordes of tags.
Last edited by starmanMike; 01-01-2018 at 04:44 PM.
Reason: one problem solved
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe