User Profile
AmedMesa
Copper Contributor
Joined Oct 23, 2019
User Widgets
Recent Discussions
Re: Filtered listbox with selected item to open record.
Tim_Marshall Appreciate the response. I don't think it is my computer given I have done this on two entirely different PCs. I have repeated this error using the same coding but written in separate db files individually. Negates a file corruption question. When I close the form I can use the OnDblClick event on the listbox as intended to pass through the selected item to the WHERE clause of the SQL statement in the other form. I get this problem when I apply a filter to the listbox based on the TextBox.Text on the OnChange event. Again, it filters the items perfectly. But, once I filter it I cannot copy the contents of what I select, though I can select any item on that list as normal. It just does not update the object properties it seems. Its blank. the ListBox.Value or .Column() is empty no-matter what.1.5KViews0likes0CommentsFiltered listbox with selected item to open record.
I have a listbox I have doing two things. It filters criteria based on a Textbox.Text with an OnChange event. Code works beautifully individually! Plenty of tutorials using a WHERE in an SQL statement for the listbox source. In this same Listbox I use a OnDblClick event to open a form and filter for the selected item using the Listbox.Column() property to forward the value to WHERE criteria of the opened form. Code also works beautifully individually. Here is my problem, say I do a search in the textbox and this filters the records of the listbox. For some odd reason I can no longer grab a value of the selected item in the listbox. Further, if I right-click to copy the field it gives me a error telling me "there isn't enough memory" which is absurd thinking the data is a few bytes on a 16GB RAM memory system. I'm scratching my head on this one for a couple of days. I tried Listbox.Value even.....doesn't matter! Again, the code works as desired individually, but I have no way of pulling data from the listbox once I apply a filter to its contents based on a form's textbox.1.6KViews0likes2CommentsRe: Combo box with "All" added to query and sorted on top.
Thanks guys for helping me solve my issue. Here is my working code: ' SELECT tblCategoryList.Category As Category, "1" As ID ' FROM tblCategoryList ' UNION ' SELECT "All Tags", 0 ' FROM tblCategoryList ' ORDER BY ID, Category; Basically I created a row in SQL called ID and all records added from the tblCategoryList table are labeled 1 under ID. The Union adds the "All Tags" and under the ID column the row is identified with 0. Then I sort via ID and followed by Category. Now I can keep the order ascending and no matter what the "All Tags" remains on top.1.7KViews0likes0CommentsCombo box with "All" added to query and sorted on top.
I have a category list that will be added to a combo box. Here is my SQL.... SELECT tblCategoryList.Category FROM tblCategoryList UNION SELECT "All" FROM tblCategoryList ORDER BY tblCategoryList.Category; So the code works, my problem is that I want the added text "All" to be placed on top of the list produced. When there is a category that contains special characters it is placed on top of "All".Solved1.8KViews0likes4Comments
Recent Blog Articles
No content to show