Experts:
I need some assisting with tweaking an existing *WORKING* keyword search form. I will describe the existing process and change requirements in bullet format below.
To better follow along w/ the process, I recommend viewing the attached JPG which illustrates the current/envisioned functionality.
Process:
- Upon opening the DB, open form "frm_KeywordSearch".
- In the top left of the form, I have a drop-down menu (1) as well as an unbound textbox (2).
Process when selecting the combo/drop-down box:
- Once you select a value from the combo, the unbound orange textbox (3) in the top right will show that value. This orange textbox (normally set to invisible) will function as the search criteria for the query.
- Based on this query search criteria, the large listbox (0) -- showing "Job Title" and "Category" -- will be populated.
Process when using the unbound textbox (underneath the combo):
- I can type in any keywords of either the job title (e.g., "analyst") or category (e.g., "grizzly bear").
- Just like with the combo, the keyword search value is passed into the orange textbox and update the query (thus update the large listbox).
... the above works great and does NOT require any modification.
Now, here's what's new and where I need some help with:
- I added another listbox (4) that currently shows 2 fields, where the 1st record reads: "Business Analyst" | "Business Analyst (7)" etc.
- I copied the VBA code from function cboSearch_Change() and replaced the references for "cboSearch" with "lstSearch".
- Now, the data is bound to the 1st column (containing only the job title).
- Just like the combo (1) or text box (2), I want to be able to select a value (e.g., "Business Analyst (7)") so that "Business Analyst" is being passed into the orange textbox (3).
- Once that is working, I more than likely will replace the combo with the new listbox.
Current issue:
- When selecting any value from the new listbox, I get a VBA error highlighting the line "vSearchString = lstSearch.ItemsSelected.Count".
- I also tried "lstSearch.ItemsSelected" but I get the same error.
My question:
- How do I need to modify the sub lstSearch_Click() so that I can use the new listbox and pass the selected value into the orange textbox/query criteria?
Thank you,
Tom