Results 1 to 4 of 4
  1. #1
    ahmad6483 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    May 2013
    Posts
    2

    Creating Conditional Report!! Please help me!

    I have a main report (based on query 1) and two subreport(based on query 2 & 3). I want to create a button to run the main report on the below conditions:

    1. If "a specific field of query 1" is equal to 1 then run the main report using "subreport 1 (based on query 2)"
    2. If "a specific field of query 1" is equal to 2 then run the main report using "subreport (based on query 3 ) "



    How can I define this in access 2010??

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Sounds like something I tried to do a long time ago and gave up on.

    Why do you have two subreports? Are they really the same datasource just with different filter criteria?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ahmad6483 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    May 2013
    Posts
    2
    there is two types of reports, there are some courses for employees, employees with grade "one" can promote to level 3 and the others can promote to level 5, for this reason classification of courses are different for example:
    courses include: a-b-c-d-e-f-g-h-i-j-k-l
    grade one should be: abc-defgh-ijkl
    the others: ab-cde-fghi-jkl

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    That didn't help me understand data structure. But possible options:

    1. Two subreport controls on main report on top of each other, code in main report Detail section OnFormat event sets visibility dependent on value in a field of main report or parameter passed in the OpenArgs argument of DoCmd.OpenReport

    2. Code to change the SourceObject of subreport

    3. The simplest approach might be two complete main reports (thank goodness for copy/paste), each with the different subreport then code would open the appropriate main report.

    I do 1 and 3 with reports and seem to remember attempts at 2 failed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  2. Replies: 5
    Last Post: 03-14-2013, 01:52 PM
  3. Replies: 6
    Last Post: 04-03-2012, 12:33 PM
  4. Replies: 3
    Last Post: 10-18-2009, 08:38 PM
  5. Conditional formatting in report
    By RickM in forum Access
    Replies: 1
    Last Post: 09-10-2009, 06:21 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