Saving last 5 search items

crich21

Registered User.
Local time
Today, 10:43
Joined
Jan 10, 2003
Messages
97
I have a search form that I would like to add a feature to. The search form has a textbox that queries the results of the search form. Upon close I would like to save the value of this textbox. Then I want to add a 5 line listbox to the search form that can display the 5 most recently searched for items. Example, I search for "paper" then close the form when I open it back up I see "paper" in the list box and I need this list to keep the last 5 search text strings. I am not very good at vba but I do understand some. thank you for your help.
 
Well

Try starting by making a new table that will hold these values plus a date/time field.

Then build a query that will find the last 5 entered based on the date/time field.

Make the Listbox based on this query.

When you leave the search form or however you are working that part have the value from the text box added to the table along with the date/time

On the OnClick event of the list box set the value of the text box to equal the value of the list box.

Only down side of this is that you end up with more then 5 values in the table and it will keep building though you should be able to make a delete query to take care of that if you want.
 

Users who are viewing this thread

Back
Top Bottom