Results 1 to 5 of 5
  1. #1
    DC CS is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Vaalpark, South Africa
    Posts
    65

    Access report records (lines) sequentially

    Hi,


    I have created an Access report where several lines are displayed. The report displays vehicles with their registration number and some other data. The report is bound to a query to retrieve the data.

    What I want to achieve, is after the records are displayed in the report, I want to access each registration number on each line, select some data from another table and do some calculations and according to the result, display this calculated data on the report in the month field.

    I tried including these calculations in a query, but there are so many calculations, I do not know how to incorporate the calculations in a query. For each month and each registration number, there are about 204 calculations based on criteria.

    My report looks something like this:
    Click image for larger version. 

Name:	Drill report.jpg 
Views:	16 
Size:	32.7 KB 
ID:	51699

    Any assistance will be appreciated.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    You would use a form for that.
    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
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Are you saying for each Month box, it could run through 204 calculations to get the value it needs? Or based on the registration say, it goes and uses the calculation specific to that?

    You might need to do these calculations in code and write to a separate table, then base the report off of that table. Just blank it out before it runs each time.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    after the records are displayed in the report, I want to ... display this calculated data on the report in the month field.
    Not possible. Once a report is generated, that's it. When February calculations are done, are the January ones done again? If so that's a monstrous amount of processing seeing as how there are more than 2400 for one registration for one year alone. The only way to avoid that is to store the calcs, which we usually advise not to do. I suspect that if there are 10 registrations and 204 per, it's still over 2K of calcs even if you store past data. I also think you'll need to use code, but not much idea of what that would look like at present.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    DC CS is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Vaalpark, South Africa
    Posts
    65
    Thanks for all your input. I thought as much that it would not be possible in a report.
    At this stage I think the best approach will be to do the calculations with code and store in a temp table and base the report on this table. Only issue I think, will be that the code for al these calculations will be messy. I will need to write quite a lot of lines to achieve this.

    Not sure if there is a simpler way.

    Regards

    Thanks a mill.

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

Similar Threads

  1. Replies: 16
    Last Post: 12-08-2016, 08:17 PM
  2. Replies: 10
    Last Post: 04-04-2016, 04:08 PM
  3. Replies: 2
    Last Post: 08-25-2015, 05:37 PM
  4. Making Access display records sequentially
    By louislinti in forum Access
    Replies: 1
    Last Post: 10-05-2013, 04:49 PM
  5. Sequentially number records in a table field
    By kenton.l.sparks@gmail.com in forum Programming
    Replies: 4
    Last Post: 04-08-2011, 08:24 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