Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Criteria in report (Access 2000)

    How could I open a report choosing criteria in the OnOpen event? I want to build a report with options from the form with the following criteria

    1. orderby Delta , in descending and ascending order
    2. to show only products where grossprice = 0
    3. to arrange the products for the category 10, 11 and 12
    4. to arrange the products for the category 1

    SELECT products.Productid, products.grade, products.code, products.size, products.ddu, products.grossprice, products.office, [office]-[ddu] AS Delta, products.categoryid
    FROM products
    WHERE (((products.exworks)>0))
    ORDER BY products.grade;

    I can do it with the Option box and making separate record sources but i hope there is a shorter way

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Criteria in report (Access 2000)

    See MSKB articles ACC2000: How to Sort a Report from a Pop-Up Form and ACC2000: How to Filter a Report from a Pop-Up Form.

    You can download a database that contains working examples of both from Access 2000 Sample: Report Topics.

  4. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Criteria in report (Access 2000)

    The recommended sources are excellent! Is there something similar for the form? I'd like to do the same in the form, to filter and order by the same query

  5. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Criteria in report (Access 2000)

    Forms and queries demos.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  6. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Criteria in report (Access 2000)

    The examples from the MSKB articles and the sample database can easily be adapted for use with a form. Instead of DoCmd.OpenReport you'd use DoCmd.OpenForm (you'll have to modify the arguments slightly) and instead of Reports!... you'd use Forms!...
    Finally, in the On Close event, you'd use acForm instead of acReport.

  7. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Criteria in report (Access 2000)

    Here is the list of currently available sample databases:

    Sample Queries
    Sample Forms
    Sample Reports
    Sample Graphs (Access 97 format)
    Sample Code (Access 97 format)

  8. #7
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Criteria in report (Access 2000)

    Thats a brilliant advice. It was so easy to build it and i saved a lot of coding. Thank you !!

Posting Permissions

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