Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Somewhere
    Posts
    21

    Question Unanswered: Reports plz Help

    for refrence - access 2002
    I am trying to open up a report i have made from inside a form, and i want to filter the report to come up with the report that goes with the current record i am on, I tryed to do it in VB but it decided to print every report i had, Any cod or help would be much appreciated, TY
    CU Blitz

  2. #2
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244

    Re: Reports plz Help

    1. Include the Primary Key Field in the form (you can hide it if you like). Let's assume it's called "MyKey"

    2. The DoCmd.OpenReport method (or macro action) should then contain a filter clause that says "MyKey = " & Forms!<NameOfForm>!MyKey", where <NameOfForm>" is the name of your form. (This assumes the key field is numeric).

    Change it to MyKey ='" & Forms!<NameOfForm>!MyKey &"'" if your key field is text.

    Hope this helps!!

    Originally posted by blitzaceuk
    for refrence - access 2002
    I am trying to open up a report i have made from inside a form, and i want to filter the report to come up with the report that goes with the current record i am on, I tryed to do it in VB but it decided to print every report i had, Any cod or help would be much appreciated, TY
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

Posting Permissions

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