FilterByForm - Reporting Problem

Abbos

Registered User.
Local time
Today, 15:00
Joined
May 11, 2005
Messages
64
Hi,

I have read through a few posts but none seem to resolve the issue I am experiencing.

I have a form with a FilterByForm button. This works fine. I also have a button that is supposed to display the results of the filter on a report. Everytime I click this button it prompts me to enter a parameter value.

Here is the code I am using for the button:

Code:
DoCmd.OpenReport "Temp", acViewPreview, , Me.Filter

Any help appriciated.
 
Instead of using "Me.Filter", do something like this:

Code:
Dim MyFilter As String

MyFilter = "'Your Filter here"

DoCmd.OpenReport "Temp", acViewPreview, , MyFilter
 
Thanks Banana,

I have changed my code to:

Code:
    Dim MyFilter As String
    MyFilter = Me.Filter
    DoCmd.OpenReport "Temp", acViewPreview, , MyFilter

I still receive the parameter prompt. From what I understand Me.Filter should hold the results of my current FilterByForm which has just been applied.
 
I'd first try and take out whatever you have in Filter By: property in form's property sheet and replace Me.Filter with that.

If you want, there's more details over there.

HTH.
 
Last edited:
Ah ha. I tried what you said and it returned:

(([Arts Query1].ArtistName = "Zao Wou Ki"))

I put this in place of Me.Filter and when I click the button I get the following error:

Runtime error 2465
Access can't find the field '|' referred to in your expression.

Anyone know what is going on as even if I change the expression I get the same error?

Thanks.
 

Users who are viewing this thread

Back
Top Bottom