Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    docmd.openreport (97 sr2)

    DoCmd.OpenReport "Rpt: Written Report", acViewPreview, "Qry: Complaints-date received", ((([Qry: complaints-Date received].TYPE) = "written"))

    Are you allowed to use the filter argument with the where argument? When I try to run this I get the error message "can't find field 'qry; complaints-date received'. What I am trying to do is use the Query to open several different versions of the same report. The where clause would give me the version of data that I want.

    Cathy

    Thanks

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: docmd.openreport (97 sr2)

    You can't use a query as part of the filter argument. In this case you want the query to be the data source for your report, and you simply put the Where condition in the filter field. Forms work the same way, and you can use the wizard to create code to open a form to a specific record - that way you can see sample code of what the Where clause should look like.
    Wendell

Posting Permissions

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