473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Saving combobox selections after a form is closed.

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:
Expand|Select|Wrap|Line Numbers
  1. Me.AF54PassDown.Form.Filter = _
  2.    "[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,
Sep 26 '13 #1
1 1106
zmbd
5,501 Expert Mod 4TB
The loss of the filter is by design.
What you could do this using the "on close" and "on load" events by saveing/reading the filter to/from a table. This could be just a single record table, or you could have the table contain user names, form names, and/or other information. I have just such a table that has the form name and the filter... when the user opens the form, it reads the table in the "on load" event and set the the filter, it then just "updates" the current form filter to the table (I don't bother with a check for changes).
There are other methods; however, this is most likely the easier to implement.
Sep 26 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Samantha Gross | last post by:
Hi! Anyone know how to save an Access form as a PDF? I want to use VB to automate the process of saving a few thousand forms as PDFs. Thanks!
2
by: Tolu | last post by:
Hello I am trying to save information from one form to two tables. I have a table for Student info and Transcript line. I have a form that list all the classes (using text boxes) a student is...
18
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
4
by: Tom | last post by:
Another question: Is there a way to determine if a form has been closed? I.E. A property or something? Like an IsClosed or something similar? I have instances where I load a new form, and in that...
0
by: Mullum | last post by:
I need some help from somebody... In me database I have build a cascade-form with 3 combobox. The first I gave in an the second attemps the first an the third attems 1 and 2. It works fine....
1
by: tizmagik | last post by:
I have a combobox on a continuous form that has a recordsource that is set upon Form_Load event via VBA (based on initial form data and external form data entered). For data entry purposes the...
2
by: Ausclad | last post by:
Hi, I have a combo box that I want to populate, based on the selection of another combo box. So when combo box A is selected, combo box B is populated with related values. I have this all...
5
by: Edd E | last post by:
Hi, I have a database to store my analyses (Access 2002, WinXp), the basic structure is: TABLE 1 = Sample Info TABLE 2 = Analysis type 1 TABLE 3 = Analysis type 2 TABLE 4 = Analysis type 3 ...
3
by: HTIDIRECT | last post by:
I am currently creating a form that requires me to have multiple comboboxes which have various options with different values. What I am having a problem with is finding a javascript snippet that...
12
by: Mr Key | last post by:
Hi all! I have 2-Combobox, one shows tablelist and another fieldlist of selected tables. the Second is activated only when the first is selected. Currently it works fine. I want to add a bit...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.