Woodywoodpecker
New member
- Local time
- Today, 09:58
- Joined
- Oct 23, 2020
- Messages
- 6
Hi everybody,
I am new to this forum and self-taught beginner in access. So sorry if my questions/way of trying things looks stupid.
My problem is as follows :
To support my question, I prepared an example database in annex where I only left the elements necessary to explain my issue.
I have :
a table : company
a query based on that table : companyQuery
a form based on taht query : companyForm
In that form companyForm,
I have * a listbox in order to point the form to a specific record : that works ok
* a "search" control that filters the listbox items based on wildcard in order to reduce the number of items from that listbox
* if I want to reset my filter on the listbox, I type a "*" in the search control
after update of that search control,
* I want the first item in the listbox to be selected (that works ok)
AND
* I want the form to update/point to that first item selected in the listbox (wheter my filter on the listbox returns one or more match).
That is where my problem is. It sometimes works, sometimes not. The behavior of what I have done is not stable and/or not working. If you play several times opening companyForm and play with the search form looking for a few characters, and then reset the filter with "*", the filter of the listbox works 100% of the time, the selection of the first item of the lisbox works 100% of the time (at least, visually on the screen) but it comes a moment where the form does not automatically move to the first selected record of that filtered lisbox.
I made some tests and I think I could detect that itemdata() of the select box does not return the same value as selected(0). But I cannot do anything with that and I am stuck.
Could you please help me on that issue ?
Thanks in advance for your help !
François.
I am new to this forum and self-taught beginner in access. So sorry if my questions/way of trying things looks stupid.
My problem is as follows :
To support my question, I prepared an example database in annex where I only left the elements necessary to explain my issue.
I have :
a table : company
a query based on that table : companyQuery
a form based on taht query : companyForm
In that form companyForm,
I have * a listbox in order to point the form to a specific record : that works ok
* a "search" control that filters the listbox items based on wildcard in order to reduce the number of items from that listbox
* if I want to reset my filter on the listbox, I type a "*" in the search control
after update of that search control,
* I want the first item in the listbox to be selected (that works ok)
AND
* I want the form to update/point to that first item selected in the listbox (wheter my filter on the listbox returns one or more match).
That is where my problem is. It sometimes works, sometimes not. The behavior of what I have done is not stable and/or not working. If you play several times opening companyForm and play with the search form looking for a few characters, and then reset the filter with "*", the filter of the listbox works 100% of the time, the selection of the first item of the lisbox works 100% of the time (at least, visually on the screen) but it comes a moment where the form does not automatically move to the first selected record of that filtered lisbox.
I made some tests and I think I could detect that itemdata() of the select box does not return the same value as selected(0). But I cannot do anything with that and I am stuck.
Could you please help me on that issue ?
Thanks in advance for your help !
François.