Results 1 to 2 of 2
  1. #1
    access122 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    1

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

    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,

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Basically, the trivial answer is "you save it to a table" with the appropriate userid.

    When a user opens the form, it uses VBA to check to see if anything is in the table for that userid, and loads that user's previous selections by selecting them in lstOpCard. If nothing, it loads blank.

    In the After Update event of the lstOpCard, you save the selections to that table with the userid. That way, you don't have to worry about what method the user uses to close the form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-28-2013, 07:54 AM
  2. Form not getting closed at first time
    By vikasbhandari2 in forum Programming
    Replies: 10
    Last Post: 07-20-2012, 01:25 PM
  3. Replies: 1
    Last Post: 03-30-2012, 11:57 PM
  4. Replies: 4
    Last Post: 08-17-2011, 05:30 AM
  5. Combobox and Saving problems
    By manicamaniac in forum Access
    Replies: 1
    Last Post: 07-31-2010, 11:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums