Topics Search

How to capture a user generated form filter

How to capture a user generated form filter
Views: 30
I'm trying to allow a user to drill down to a selection of records using the individual drop-down filters in the datasheet view of a split form, and from there make modifications to just the filtered records using VBA code.

and I can't figure out how to use code to save the manual filter choices. When I open and edit the recordset based on the form's recordsource query, it edits all the records in the query, not just the filtered set.

I think I need to save the filtered version of the query behind the form before I can work with just those records,
Sponsored Links:

More topics


On No Data Event

Is there a Forms event similar to the On_No_Data event with reports? I have a small form that builds a filter for a recordset. If I run a DoCmd.OpenReport I can trigger No Data event when the filter finds no records. However, if I use a DoCmd.OpenForm with the same filter, a blank form displays. I would like to prevent the Form from displaying if no records are found by the filter. What is a good approach to capture the fact that no records meet the filter criteria?

Capturing Autonum on New Record Insertion

I'm looking for a method to capture the unique id for a row that is inserted into an Access table. I have a command button that I would like to do the following:

1) insert the fields in a form into the supporting table;
2) capture the autonum generated unique identifier in a field on the form;
3) have this data available to pass to a subform based on a table with a one to many relationship to the previous table.

Showing a filtered data description on form

I am currently experimenting with Access and I would like to create a feature where user can check on their number of task based on their updates. I have currently created a form where it can capture user NT login and filter the task based on the user NT login

For example, User A just completed 20 out of 120 of his task. Can this kind of statement appear on the form

Total task : 120

Use subforms filter for chart record source

I have a sub form and related chart in 07. Can I capture the filter on the sub form and use it to filter the chart?

Save current filter as query (realtime)

They are using a QBF (Query By Form) and then applying that filter. I then have a button on that form they can click that needs to print out only the reports of the records which fit the QBF.

1. When a user creates a QBF and clicks apply filter,


2. What is the name of the current filter? In otherwords, when a user creates a QBF and clicks apply filter, MSAccess is applying that filter which it has stored somewhere -- what is the code name of that filter? (eg. Me.CurrentFilter)


3. How can I allow a user to filter a form and then print the filtered list (not all of the records, not just one, but the ones that matched the filter).

Possible to have single filter for a mix of blank and non blank criteria?

Though there are lots of threads about multiple criteria.

Is it possible to have a SINGLE filter button that filters a form only by the filter criteria that the user specifies and not the possible criteria that the filter may have? That is, ifthere are multiple criteria that the user can filter by but she only chooses to specify, say, two out of five, and leaves the other three filter boxes blank, I want the filter to only pickup the ones she specified and NOT filter by Nulls in the other three fields.

I have 5 fields on which the user can filter by typing in what they want in text boxes. I don't want to have 5 separate filter buttons, I want just one that sets the filter on all the specified criteria.

Is it possible for the button to pick out only the criteria that the user specified? I mean, without having to go through ten thousand if statements like

If len(me.filterfield1)>0 and len(me.filterfield2)= 0 and. len(me.filterfield5)= 0 then
'set filter string to just the first criteria


.and so on.

Or is it better to just have a separate filter button for each text box?

Open a second report and apply the first report's user filter

I have a report (rptStudy) which a user can filter by means of several text boxes in a form (frmSearch). The filter criteria is entered into the form which then opens the report, applies the filter, and closes the form. Works great. Here is my problem: I would like to have a command button on the report (cmdOpen) which opens a second report (rptStudy2) while keeping the same filter applied to the second report.

I'm sure the solution is easy, but I cannot find it anywhere

Opening a form to a specific record

I have a button the user presses to save the record, close the form, and open up another form to the most recent record where theuser can enter in more detailed data about the record.

This approach works just fine in a single user input situation. However, if I have multiple users doing data input this causes some issues.

For Example:

User A assigns the records primary key (#1) with the first keystroke entered. User B begins to input, assigning a new primary key (#2) to the new record. User A finishes the basic input and presses the button saving the record and opening the second form for more detailed entry.

As the second form takes you last record enterend, the record displayed for user A has the primary key of #2.

This is not the record User A started with but is the record being prepared by User B.

Essentially, what I'm looking to do is, capture the value of the primary key close the first form and open the second form where the primary key is equal to the capture value.

Filter Subform from user input

I have a main form (frmMainMenu) and a subform (frmSub). I already have a number of filters, which filter by specific data. Here is the code i am using for that:

With Me.frmsub.Form .Filter = "[Franchise] =" & """Abarth""" .FilterOn = True End With

I am wondering if i can using something similar to either prompt for a user input, or for the user to type what they want to filter in a text box, and filter by that?

Automatic Filtering when Opening form

Is there a way to set up a form so that it applies a filter automatically when the form is opened so that a user only sees the filtered records without having to press the filter toggle or filter every time?