Saving a combobox after a form is closed and re-opened

Access122

New member
Local time
Today, 03:22
Joined
Sep 26, 2013
Messages
1
Hi all,

I have exhausted my efforts to no avail. I would really appreciate your guys help on this one!

I have a main form called frmAF54. In this main form I have a subform named frmPassdown. The subform record source is from a table called tblCards. This table contains many different cards. I have a combobox called lstOpCard in the main form as well. The combobox lists all of the different cards in "tblCards". I have a button called "buttonFilter".

A user opens the form and clicks (or selects) the different cards in the combo box "lstOpCard" that they want to filter for. Once their selections are made, they can click the "buttonFilter" button and the subform "frmPassdown" will be filtered based off of their selections.

The filter is applied using the IN() function as shown below:
Me.AF54PassDown.Form.Filter = "[OpCardID] IN ( " & sTemp & " )" --sTemp is a string containing the keyIDs of the cards selected.

My problem is that people will be opening and closing the form throughout the day / week. When the form closes, it loses the applied filter. How can I have my filter on the subform be saved after the form is closed and the filter is still applied when the form is opened later?

Your help is very much appreciated!! If you need any additional information, please let me know. Providing code will be a huge help to me as well as I am new to access.

Thank you,
 
Hi
How many users do you have using the same DB? I infer that you want to keep the filter criteria for each user on an individual basis?
Have you considered using a table to save the filter criteria, then restore the user's setting when the form is next opened (in the Form_Open event)? This would require some mechanism to identify each user, which you would use as a key to the table in order to retrieve the relevant setting. Presumably you would also need to have some means to clear the settings?
HTH
 

Users who are viewing this thread

Back
Top Bottom