"Enter parameter value" popup when I try to filter

swee

Registered User.
Local time
Yesterday, 19:56
Joined
Aug 11, 2004
Messages
66
Hi all,

When I try to filter my report through input into a form, I get a pop up box that says "Enter parameter value" when I click on the button to filter the report. Has anyone experienced this before?

Regards,
Swee
 
Only when I've misspelt my references to the control on the form

Brian
 
I think it might be my code that could be the problem.
Code:
    Dim strACCode As String
    Dim strFilter As String

    ' Build criteria string for A/C Code field
    If IsNull(Me.txtAccCode) Then
        strACCode = "Like '*'"
    Else
        strACCode = "='" & Me.txtAccCode & "'"
 '       "='" & Me.cmbReference.Value & "'"
    End If

    strFilter = "[B][Report]![RptLookupRecords].[Report]![SubFrmLookupRecords]![Acc_Code] " & strACCode[/B]

    ' Apply the filter and switch it on
    With Reports![RptLookUpRecords]
        .Filter = strFilter
        .FilterOn = True
    End With

I think the line bolded above could be causing the problem. Or is it something else?

Note: RptLookupRecords is the report that I want to filter and SubFrmLookUpRecords is a subreport inside that report.

Thanks a lot,
Swee
 
Should it be
strFilter = "[Reports]![RptLookupRecords].[Report]![SubFrmLookupRecords]![Acc_Code] " & strACCode

Brian
 
Tried that and it doesn't work still. Uploaded a small db of mine for you to understand what the problem is like. FrmFilterAccCode is the form for you to enter the field to filter and RptLookupRecords is supposed to display the related results. The Acc Code can be found in the subreport of RptLookupRecords.

Hope you all understand it better. Thanks!
 

Attachments

Sorry Swee I cannot help.
What you are trying I've never done but can I ask, rhetorically perhaps, how is it supposed to work. Selecting a main Report will automatically link to the relevant subreport via the LINK field but does it work the other way?, as the acc_code is on the sub report how can it filter the main? Surely you need to find the PONum for the Acc_code then filter the Main form on the equal PONumber , which seems to be the link.

Of course the above could all be a load of C**p :)

Again sorry I cannot help, hope somebody else can.

Brian
 
Sounds like the sequence is off - Circular Ref

Whenever calling a sub....The main has to be settled....

Having a Main that relies on a sub's data will never fly because it doesn't know where to look.

Sometimes, it will pop the parameter box, and you can ignore it and it will still populate.

if it is...slip in a little...

docmd.setwarnings = false

and wallah!!!

flawed code covered....you may want to leave yourself a little note behind tho.....
 
I think I get the point. Looks like it's not viable to work in that direction. I'll make some adjustments to the design of my system. Thanks for everybody's time.

Cheers,
Swee
 

Users who are viewing this thread

Back
Top Bottom