Results 1 to 15 of 15
  1. #1
    mark6455 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    10

    Report to find only records that are checked in a checkbox

    I have posted this question before and still cannot find the proper format. I figured I would try one more time with what I hope is more clarity on what I need. I wrote this database years ago and have forgotten a lot since I have not done programming for so long.

    I have a detailed database to track every item about my pickup truck. Fuel use, maintenance, issues, years owned and more. Specifically, I need the following:

    I have a checkbox that if checked means the truck had a regeneration of the of the diesel emissions. The checkbox is labeled "Regeneration". I want to create a report that ONLY lists a data entry on the report if the checkbox is checked.



    I want to take the starting mileage called "Mileage this trip" and subtract this from the ending mileage called "Ending Mileage" ONLY if the checkbox is checked. I need a printout of all the regenerations only that the truck has done.

    In my mind, If Regeneration is true then Ending Mileage minus Mileage this trip will show in the printout but only for a Regeneration. To this date, I have had 179 regenerations in 7 years so that is the only information I need on this report.

    Thank you.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,553
    So use that as criteria for the query that supports the report.
    WHERE Regeneration = True

    I believe you were already shown how to take one value from another.? I will call that the math query.

    In fact if you are that rusty, create two queries. The first just gets all regens with their mileage ordered by date.
    Then use the math query to get the difference between each record. Use that query for your report.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Which table is the yes/no field in? Post SQL of attempted query.

    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.

  4. #4
    mark6455 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    10
    Quote Originally Posted by June7 View Post
    Which table is the yes/no field in? Post SQL of attempted query.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    The YES/NO table is called REGENERATION.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Yes/No field is called REGENERATION and it is in which table?

    What is the SQL statement?

    If you still need help, fastest way to get resolution is to provide database.
    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.

  6. #6
    mark6455 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    10
    Sorry I forgot to put it in the reply; table is Expenses.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Really, pulling teeth here.

    What is the SQL statement?

    Don't think I will reply any more unless db provided as requested.
    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.

  8. #8
    Micron is online now Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    Looks to me that this is about your other thread, which has replies but you seem to have abandoned. You won't win any points by creating a new thread for the same issue if that's what you've done.
    https://www.accessforums.net/showthread.php?t=84333
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    mosinjack is offline Novice
    Windows 10 Access 2003
    Join Date
    May 2025
    Posts
    2
    This is definitely doable! In your report’s query, set the criteria for the "Regeneration" checkbox field to True (or -1 in Access). Then add a calculated field like =[Ending Mileage]-[Mileage this trip] to show the distance per regeneration. That should filter your report to only show regeneration entries with the mileage difference.

  10. #10
    mark6455 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    10
    cannot provide database. Legal reasons.

  11. #11
    Minty is offline VIP
    Windows 11 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    If it's your truck and your database, I doubt there are any legal ramifications.
    Just anonymise the truck data.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    jojowhite's Avatar
    jojowhite is online now Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    you create a Query against the table that has the "regeneration" field:

    Code:
    SELECT *, [end mileage] - [mileage] AS MileageDiff FROM YourTableName WHERE [regeneration] = True ORDER BY [date field from your table];
    save the query and create a Report based on the query.

  13. #13
    mark6455 is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    10
    Lawsuit in progress with Nissan. Cannot send DB at lawyer's advice until suit is over.

  14. #14
    jojowhite's Avatar
    jojowhite is online now Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    you create a Copy of the db, so you only send the Copy not the original.
    i think you need to get the approval of your lawyer for any modification to your db
    while litigation is in progress.

  15. #15
    madpiet is offline Expert
    Windows 10 Office 365
    Join Date
    Feb 2023
    Posts
    564
    Then post the query.

    And maybe for the tables involved, create a query for each with all the columns. We don't want your data, thanks.

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

Similar Threads

  1. Replies: 12
    Last Post: 12-31-2019, 07:37 AM
  2. Replies: 7
    Last Post: 03-17-2016, 10:42 AM
  3. Print Checkbox on report only if checked
    By azhar2006 in forum Reports
    Replies: 5
    Last Post: 10-26-2014, 11:59 PM
  4. Replies: 4
    Last Post: 06-03-2014, 10:30 AM
  5. Checked Box + Date = Checked box
    By ItsATJ in forum Access
    Replies: 12
    Last Post: 09-03-2013, 10:25 AM

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