I need one of my report to show exactly the same records as one of my
subform. I created a button doing this (which is working) :
DoCmd.OpenReport "00-GetOutstandingSalesOrder", acViewPreview, ,
Form_CustomerOutstandingSalesSubForm.Filter
The problem is if I close my report and remove all filter on the subform
then click the button again, the last filter is still apply on my report.
Would like to see all record if there is no filter apply.
My Subform is in datasheet view which I filter using the filters toolbar
button. I also have a report based on the exact same record source then my
subform.
Any suggestion?
--
Yanick
|
|
0
|
|
|
|
Reply
|
Utf
|
12/15/2009 7:16:01 PM |
|
Yanick wrote:
>I need one of my report to show exactly the same records as one of my
>subform. I created a button doing this (which is working) :
>
>DoCmd.OpenReport "00-GetOutstandingSalesOrder", acViewPreview, ,
>Form_CustomerOutstandingSalesSubForm.Filter
>
>The problem is if I close my report and remove all filter on the subform
>then click the button again, the last filter is still apply on my report.
>Would like to see all record if there is no filter apply.
>
>My Subform is in datasheet view which I filter using the filters toolbar
>button. I also have a report based on the exact same record source then my
>subform.
You should not use the Form_ syntax except when creating
multiple instances of the same form. Instead, assuming the
name of the subform **control** is named the same as the
form object it displays, use:
With Me.CustomerOutstandingSalesSubForm.Form
DoCmd.OpenReport "00-GetOutstandingSalesOrder", _
acViewPreview, , IIf(.FilterOn, .Filter, "")
End With
--
Marsh
MVP [MS Access]
|
|
0
|
|
|
|
Reply
|
Marshall
|
12/15/2009 11:01:46 PM
|
|
Marshall,
What is your reason for advising Yanick not to use the "Form_" syntax of
refering to filter property of a form? Is this recommendation specific to
this instance or is there something else involved with this syntax that we
should all know about?
I've been using the Form_FormName.control for quite some time and have not
experienced any unforseen circumstances (at least none that I'm aware of).
The advantage of using that syntax is that you get intellisense.
----
Dale
"Marshall Barton" wrote:
> Yanick wrote:
>
> >I need one of my report to show exactly the same records as one of my
> >subform. I created a button doing this (which is working) :
> >
> >DoCmd.OpenReport "00-GetOutstandingSalesOrder", acViewPreview, ,
> >Form_CustomerOutstandingSalesSubForm.Filter
> >
> >The problem is if I close my report and remove all filter on the subform
> >then click the button again, the last filter is still apply on my report.
> >Would like to see all record if there is no filter apply.
> >
> >My Subform is in datasheet view which I filter using the filters toolbar
> >button. I also have a report based on the exact same record source then my
> >subform.
>
>
> You should not use the Form_ syntax except when creating
> multiple instances of the same form. Instead, assuming the
> name of the subform **control** is named the same as the
> form object it displays, use:
>
> With Me.CustomerOutstandingSalesSubForm.Form
> DoCmd.OpenReport "00-GetOutstandingSalesOrder", _
> acViewPreview, , IIf(.FilterOn, .Filter, "")
> End With
>
>
> --
> Marsh
> MVP [MS Access]
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
12/16/2009 9:41:02 PM
|
|
Dale Fye wrote:
>What is your reason for advising Yanick not to use the "Form_" syntax of
>refering to filter property of a form? Is this recommendation specific to
>this instance or is there something else involved with this syntax that we
>should all know about?
>
>I've been using the Form_FormName.control for quite some time and have not
>experienced any unforseen circumstances (at least none that I'm aware of).
>The advantage of using that syntax is that you get intellisense.
If there should be multiple instances of a form object (e.g.
the same subform used in more than one place or forms opened
via Set frm New Form_X), Form_ will refer to the default
instance and not to the instance you may think you are
referencing. The only way I know of to be sure you
reference the instance you intend is to use a specific form
object. In the case of subforms, the Form property of the
main form's subform control.
--
Marsh
MVP [MS Access]
|
|
0
|
|
|
|
Reply
|
Marshall
|
12/16/2009 10:50:09 PM
|
|
Thanks, Marshall. That is what I thought.
Dale
"Marshall Barton" <marshbarton@wowway.com> wrote in message
news:d6oii5lne0ckqbn4cuiusduot81oohllve@4ax.com...
> Dale Fye wrote:
>>What is your reason for advising Yanick not to use the "Form_" syntax of
>>refering to filter property of a form? Is this recommendation specific to
>>this instance or is there something else involved with this syntax that we
>>should all know about?
>>
>>I've been using the Form_FormName.control for quite some time and have not
>>experienced any unforseen circumstances (at least none that I'm aware of).
>>The advantage of using that syntax is that you get intellisense.
>
>
> If there should be multiple instances of a form object (e.g.
> the same subform used in more than one place or forms opened
> via Set frm New Form_X), Form_ will refer to the default
> instance and not to the instance you may think you are
> referencing. The only way I know of to be sure you
> reference the instance you intend is to use a specific form
> object. In the case of subforms, the Form property of the
> main form's subform control.
>
> --
> Marsh
> MVP [MS Access]
|
|
0
|
|
|
|
Reply
|
Dale
|
12/16/2009 11:01:38 PM
|
|
|
4 Replies
255 Views
(page loaded in 0.09 seconds)
Similiar Articles: Report based on a filtered form - microsoft.public.access ...I need one of my report to show exactly the same records as one of my subform. I created a button doing this (which is working) : DoCmd.OpenRepor... Filter data by using a form and open a report based on this data ...Hello, I created a form with 3 criterias: location, date to and from and course name. I have a reset button and a filter/search button. I want to open a report called ... Using filtered form data as record source for report - microsoft ...Filter data by using a form and open a report based on this data ... Using filtered form data as record source for report - microsoft ... Open Form filtered - microsoft ... Filter 2nd form based on a field value of 1st form - microsoft ...Report based on a filtered form - microsoft.public.access ... The Users need to filter the records by ... Filter 2nd form based on a field value of 1st ... Check box filter value - microsoft.public.access.reports ...I am trying to filter a report (based on a qry) through a form. They do want the one option I wanted to take out. In the report, there is a check b... how to filter multiple fields? - microsoft.public.access.forms ...Hello, I would like to create a form that allow the users to filter multiple fields to either edit or run a report based on the filtered fields. The... Filter Subreports from Form OnClick with VBA - microsoft.public ...Filter data by using a form and open a report based on this data ... Onclick I have filter all 3 criterias but I don't know how to open a report. ... Viewing a report of filtered resutls using a Command Button ...Report based on a filtered form - microsoft.public.access ... Viewing a report of filtered resutls using a Command Button ..... code opens a filtered report, then the ... Filter based on unbound text box with default value - microsoft ...... based on unbound text box with default value - microsoft ... Filter 2nd form based on ... In my unbound text box at the ... Filter a Report Based on an Attribute a to be ... Filter a Report Using a Form's Filter - microsoft.public ...How to: Filter a Report Using a Form's Filter The following example illustrates how to open a report based on the filtered contents of a form. To do this, specify the form ... ACC2000: How to Filter a Report Using a Form's FilterThis article describes how to create a command button on a filtered form that, when clicked, opens a report and applies the filter that is on the form to ... Report based on a filtered form - microsoft.public.access ...I need one of my report to show exactly the same records as one of my subform. I created a button doing this (which is working) : DoCmd.OpenRepor... How to: Filter a Report Using a Form's Filter [Access 2007 ...The following example illustrates how to open a report based on the filtered contents of a form. To do this, specify the form's Filter property as the value of the ... Printing a report based on the filtered results of a form - Access ...Microsoft Access Discussion > Reports ... Here is the problem: I have a form where the user selects a value from an unbound ... Take a look at the attached file. It a ... Report based on form filter? DataBase - DataBase Discussion List ...Hello, I have a form with Multiple fields filter based on and event procedure where I can filter multiple combo fields. I would like to print a report af 7/17/2012 9:42:11 PM
|