Results 1 to 8 of 8
  1. #1
    M.Enders is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    9

    Conditional Report Details

    Good Evening All,



    I am trying to conditionally display details in an access report. In the attached picture I only want to show details of items without a checkmark and have no details shown for ones with a checkmark, how would you go about doing this?

    Click image for larger version. 

Name:	Capture.PNG 
Views:	28 
Size:	7.2 KB 
ID:	35097

    Thank you in advance.

    Marty.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If the report is based on a table, you will have to filter it to exclude records where the checkbox is True or -1.
    If it's based on a query, modify the query criteria to do the same.
    If the 4th row values are related to the 3rd, wouldn't indenting them make it more obvious that they are related (are child records)? I ask because row 2 is greatly indented and doesn't have a checkbox. Row 3 isn't indented (same as row 1 and 3) yet it doesn't have a checkbox. So my answer is based on my interpretation of what's presented.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    M.Enders is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    9
    Micron,

    So it is a report based on a query.
    Click image for larger version. 

Name:	Capture2.PNG 
Views:	21 
Size:	31.6 KB 
ID:	35101
    I am not sure on how to get Access to only show the details if the Individual Issue Yes/No Field is unchecked.
    Click image for larger version. 

Name:	Capture3.PNG 
Views:	21 
Size:	23.5 KB 
ID:	35102
    So in the below example from the report, I want the details section below the Pistols to be empty because the yes/no field is checked, while I want the details section below the Radio set to be populated as the yes/no field is uncheck.
    Click image for larger version. 

Name:	Capture4.PNG 
Views:	21 
Size:	7.9 KB 
ID:	35103

    Hope you can help as I am hitting a wall.

    thank you

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Code in group header OnFormat event can conditionally display the Detail section. OnFormat events only trigger in PrintPreview or direct to printer.

    Me.Detail = Not Me.[yes/no field name]
    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.

  5. #5
    M.Enders is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jun 2017
    Posts
    9
    June7,

    Thank you so much for pushing me in the right direction here is how I got it to work.

    Click image for larger version. 

Name:	Capture5.PNG 
Views:	17 
Size:	8.7 KB 
ID:	35105

    And the end result

    Click image for larger version. 

Name:	Capture6.PNG 
Views:	17 
Size:	5.9 KB 
ID:	35106

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Can be a one-liner

    Me.Detail = Not Me.Text182
    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.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by June7 View Post
    Can be a one-liner

    Me.Detail = Not Me.Text182
    Or

    Me.Detail.Visible = Not Me.Text182

    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Ooops, thanks for the catch, Paul.
    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: 4
    Last Post: 08-11-2018, 11:22 AM
  2. Replies: 7
    Last Post: 04-16-2018, 07:43 PM
  3. repeating details in report
    By msnarayanan in forum Reports
    Replies: 2
    Last Post: 09-25-2015, 08:41 AM
  4. if report qty is empty hide all details
    By mathanraj76 in forum Reports
    Replies: 4
    Last Post: 06-11-2013, 12:07 AM
  5. Missing client details report
    By crxftw in forum Reports
    Replies: 3
    Last Post: 08-16-2011, 12:19 PM

Tags for this Thread

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