I have three list boxes on a window. Each list box loads info from a different table. All load fine. I have fields that load new entries into the tables. These work fine. The same, update and delete buttons work fine.
If I double-click on a row in list box 1 it loads the row into the text fields fine. The same with the second and third list boxes.
When I double-click any of the list boxes and the appropriate text fields for that list box are loaded, some or all the text fields for the other list boxes that were previously loaded are cleared of information. I cannot find a reason or solution for this. Is this standard or have I coded something in by error.
If anyone might have an answer or can point me in the right direction I’d appreciate it. Thank you.
Jeff, no. the tables have different names as well as the list boxes. The text boxes are different in name. Within the tables several varchars have same names such as first varchar, last varchar but each table is separate.
I appreciate the responses. The code would be large to show the problem due to the three tables involved. I did solve the problem by making a temporary text for each of the text fields, saving the existing text field text then after the list box double click on the row which would have for some reason deleted the text field texts, I reverse loaded the text fields back, so no loss of text occurred. Hope I explained it well enough. It is not elegant, but it works and didn’t require much code.
Its not the tables.
If text fields get emptied, you need to look hard at the code that sets the .text property of those fields.
Something is wiping the values at the wrong time, and it will be in your code.
Look for lines that set the text to be “”
The same happened to me once. What I (previously) did was to copy 1 of the other listbox to build the new wrong-one.
I use having a (main) listbox where, after selecting data (click) update related info to the rest of the listboxes.
After deeply review on my wrong listbox, I didn’t found anything at all, not on the code, nor on listbox’s properties.
What solved to me was to build a new listbox (the object itself) and copy-paste the code to the new object. This way it did work without problem. Again, I reviwed all properties/parameters on both listbox’s objects, and didn’t found any difference, but it is working. Finally deleted old wrong-object and no more problem up to today.
On the other hand, what I do, on this window (I have 5 different listbox), is to pass all needed data, also, to a temporary property This way it’s easier, for me, to handle all -interesting data- instead of handling data from the listbox. I feel this can be a good idea to consider.
Change the name of one of the TextFields that are changed when they must stays the same and run: you will get the error and where to search who wrongly clears your TextFields…