Filter a form based on continuous form (1 Viewer)

Falcon88

Registered User.
Local time
Today, 19:16
Joined
Nov 4, 2014
Messages
299
Hi all
I want to filter the main form that displays a single record based on continuous form that may be displays multi records ,( not the current record on the continous form but on the displayed records ).
 

Falcon88

Registered User.
Local time
Today, 19:16
Joined
Nov 4, 2014
Messages
299
Thanks but splitform filter one record only ....
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2002
Messages
43,226
That's right but you have more control if you replicate the functionality of the split form. The main form displays a single record. The subform contains multiple records. If you pick one record, that's the one that will be used to filter the main form. Otherwise, we don't know what you are trying to do.

If you are saying you have a continuous form that you filter and you want to use that to control a separate single record form, the question would be why, but you can do it by passing the filter from one form to the other using the OpenArgs. A more likely scenario is to add code to the double click event of the filtered form that opens the selected record in single form view.
 

Falcon88

Registered User.
Local time
Today, 19:16
Joined
Nov 4, 2014
Messages
299
That's right but you have more control if you replicate the functionality of the split form. The main form displays a single record. The subform contains multiple records. If you pick one record, that's the one that will be used to filter the main form. Otherwise, we don't know what you are trying to do.

If you are saying you have a continuous form that you filter and you want to use that to control a separate single record form, the question would be why, but you can do it by passing the filter from one form to the other using the OpenArgs. A more likely scenario is to add code to the double click event of the filtered form that opens the selected record in single form view.
Thanks for your replay
On the head of continuous for i use unbound textboxes and comboboxs to filter that continuous form for general data that filter that c.form to displays multiple records based on that unbound textboxes , i want a command button to open the single form by filtering based on that displaied records .
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2002
Messages
43,226
We may be having a language issue.

Add a double-click event to the ID field displayed in the continuous form. In that event, use the OpenForm method to open the single record form. Use the WHERE argument of the OpenForm method to specify the autonumber of the selected row.
 

Falcon88

Registered User.
Local time
Today, 19:16
Joined
Nov 4, 2014
Messages
299
We may be having a language issue.

Add a double-click event to the ID field displayed in the continuous form. In that event, use the OpenForm method to open the single record form. Use the WHERE argument of the OpenForm method to specify the autonumber of the selected row.
Thanks

But could you give me an example .
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2002
Messages
43,226
Intellisense is pretty good. You just start typing and Access helps you out.

DoCmd.OpenForm "yourformname", , , "SomeFieldID = " & Me.SomeFieldID

Put the code in the double-click event of which ever control makes sense to you. The ID of the record in the row selected is what gets used in the Where argument. Obviously, substitute your own column and control and form names.
 

Falcon88

Registered User.
Local time
Today, 19:16
Joined
Nov 4, 2014
Messages
299
T
Intellisense is pretty good. You just start typing and Access helps you out.

DoCmd.OpenForm "yourformname", , , "SomeFieldID = " & Me.SomeFieldID

Put the code in the double-click event of which ever control makes sense to you. The ID of the record in the row selected is what gets used in the Where argument. Obviously, substitute your own column and control and form names.
This will filter only the current record .
Notice : i want like filter by extended listbox that select more than record.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2002
Messages
43,226
This will filter only the current record .
I know that. The single view form is only showing one record at a time.
i want like filter by extended listbox that select more than record.
Your original request was based on you using a subform and I told you how to do this. Copy the filter of the multi-record form and pass it to the single record form and in that form's Load event, apply the filter from the OpenArgs.

Me.Filter = Me.OpenArgs
Me.FilterOn = true.

If you are using a muti-select list box, take a look at the examples in this database.

 

Users who are viewing this thread

Top Bottom