i think you're missing the point of a list box. the reason you have a listbox is so you have Options to choose from, which inturn normally populate or open records, etc.. Searching a listbox doesn't seem very friendly.
your list box should be "ordered" in some manner, based on your table.
i think what you might want instead is to just use a filter without a listbox.
I'm not 100% sure of what your'e trying to achieve, but it does appear to me that you are using a list box in a less than friendly way for a listbox to be used.
I could be wrong, but if you clarify what you are trying to achieve perhaps i could help you, then again.. this might be out of my league. Cruz'n and Booz'n always.
This post shows what little I do at work.
I suggest that you have the listbox bound to an existing table. then use the listbox to display the choices, but go to the recordset for the actual value. Sort of like this.
' create a table with your data that you want in the listbox.
' then in the form load place listbox0.rowsource = "SELECT * FROM TABLE"
On a command button next to the listbox do the following.
dim rs as adodb.recordset
dim cn as adodb.connection
set rs = new adodb.recordset
set cn = currentproject.connection
rs.open "SELECT * FROM TABLE",CN,ADOPENSTATIC
ME.TEXT.VALUE = RS!FIELDNAME
RS.CLOSE
CN.CLOSE
SET RS = NOTHING
SET CN = NOTHING
'(TEXTBOX NAME) = (TABLE FIELD NAME)
** IF YOU WANT TO HAVE THE ITEM DISAPPEAR FROM THE LISTBOX, YOU MUST DELETE IT FROM THE TABLE AND INSERT IT AGAIN WHILE REQUERYING THE LISTBOX EACH TIME.
** HOPE THIS HELPS.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.