Results 1 to 2 of 2
  1. #1
    racefan91 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    56

    Is it Possible To code form criteria for multiple subreports?


    I am running a tournament database and I was wondering if there is a way to run some code to produce my results in a report. I have a form with some criteria boxes that runs a wins/losses query. For example, if I enter in 1 for the rank it will produce in my query the number of people that have been number 1, shows how many wins they have when ranked 1, how many losses and a winning percentage. What I am pondering now is if it's possible to code the 64 possible ranks as criteria and display each result in a report. If it's possible I can post the coding I have right now for someone to help me.

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Sure, post it up.
    Offhand, it would seem that you could create a rudimentary table with only the numbers 1 thru 64, and do a join with that single field in the rank criteria for the other query.
    Assuming your first query (simpified) looks like this:
    Code:
    Query1:
    SELECT MyField1, Myfield2  etc
    FROM MyTable etc
    WHERE MyFieldX = Forms!MyForm!MyControl;
    Then you end up with a second query that (simplified) looks like this:
    Code:
     
    Query2:
    SELECT RT.NumField, Q1.MyField1, Q1.MyField2 etc
    FROM RudTable AS RT, 
         (SELECT MyField1, MyField2  etc
          FROM MyTable etc
          WHERE MyFieldX = RT.NumField) AS Q1
    ORDER BY whatever;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 04-04-2013, 05:32 PM
  2. Replies: 4
    Last Post: 01-25-2013, 01:57 PM
  3. Code for using a list box for criteria in a form
    By tomnsd in forum Programming
    Replies: 7
    Last Post: 01-23-2013, 10:52 PM
  4. Replies: 5
    Last Post: 05-18-2011, 11:02 AM
  5. Multiple Subreports with page break
    By rayc in forum Reports
    Replies: 7
    Last Post: 09-02-2006, 06:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums