Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mysterious parameter prompt (Access 2000 SR-1)

    Hi,

    I'm using the DoCmd.OpenReport VBA method and I keep getting a mysterious dialog box. It's titled Enter Parameter Value, and its text is the value that I was using as the filter in the OpenReport method. I'm not sure where this dialog box is coming from, since the query does not have any parameter statements in the criteria boxes. Also, I haven't specified anything in the Query > Parameters dialog box in the query.

    The input box on this Enter Parameter Value dialog box is empty. If I leave it blank and press OK, the report produces without any data. If I enter the filter value in the input box, the report comes out OK.

    I've attached a copy of the dialog box to show what is appearing.

    Thanks,
    Bob
    Attached Images Attached Images

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mysterious parameter prompt (Access 2000 SR-1)

    Hi Bob...

    Can you show me the DoCmd statement?

    What's happening is that Access won't accept a string value in the Filtername argument of a DoCmd.OpenReport statement...
    It wants the name of a saved query that filters as you need it... You can do that if you want... Instead, I normally use the Where condition argument...
    DoCmd.OpenReport "Your Report Name", acViewNormal, , "[YourField] = 'CR005464'"
    (Even though it's optional and not being used, you need to leave the comma in the right place for the filtername argument... )

    You'll have to substitute your names in there... and if you are using a variable to hold onto the filter value you'll need to do it a little differently...
    If you can give me a few more details and the required names I can probably help you with it...

    HTH

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mysterious parameter prompt (Access 2000 SR-1)

    Here is the whole function:

    PrimaryCR = [Forms]![Corrections Entry]![CR Subform].[Form]![CorrCR]
    RptFilter = "[CorrCR]=" & PrimaryCR
    DoCmd.OpenReport "AdHocCorrectionsListing -- New", acViewNormal, "AdHocCorrectionsListing -- New", RptFilter

    Thanks,
    Bob

  4. #4
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mysterious parameter prompt (Access 2000 SR-1)

    Well first of all, I don't understand why the Report name is in the Filter argument area of the DoCmd.OpenReport statement, so I'd get rid of that... And second, I believe that you aren't telling Access that the value is a string... Try this....

    PrimaryCR = [Forms]![Corrections Entry]![CR Subform].[Form]![CorrCR]
    RptFilter = "[CorrCR]='" & PrimaryCR & "'"
    DoCmd.OpenReport "AdHocCorrectionsListing -- New", acViewNormal, , RptFilter

    Or to simplify...

    DoCmd.OpenReport "AdHocCorrectionsListing -- New", acViewNormal, , "[CorrCR] = '" & [Forms]![Corrections Entry]![CR Subform].[Form]![CorrCR] & "'"

    I haven't tested this, so let me know how it goes okay? <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    HTH

  5. #5
    2 Star Lounger
    Join Date
    Jun 2001
    Posts
    146
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mysterious parameter prompt (Access 2000 SR-1)

    That worked. Thanks a lot for your help.

    Bob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •