Results 1 to 7 of 7
  1. #1
    EddieN1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2011
    Posts
    313

    Run a Report from a Class Module

    I have a need to let a User output a large report to a pdf file. It takes about 10 minutes for the report to run. Is there a way to use a Class Module to generate the report while the User is able to do other tasks in the Access database?

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    What is the cause of the long wait time: getting a large amount of data? Slow calculations? Rendering a lot of images? If the problem is not getting the data, you could copy the data to a second Access application that renders the report while the user can continue to work in the current access file.

  3. #3
    EddieN1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2011
    Posts
    313
    The reason for my question has to do with using Class Modules, not processing speed. Is what I'm trying to do a reason to use a Class Module?

  4. #4
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,043
    IMO not, a class module is only a very structured way to write your code

  5. #5
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    I don't believe a custom class will run in the background whilst your user continues to do other tasks.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    Edgar is online now Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    274
    You might be looking for the DoEvents function to let the user do something else (except trigger the same code again before the first has finished). A class module is a helper for you to write code in a more organized way, like others have said. In VBA you are working with classes all the time, Forms, Controls, Fields, TableDefs, and other objects are class modules. We can not see how they are constructed, but we can access their properties and methods. For example, if you create a "Human" class, you can define properties like "Name", "Age" and "PhoneNumber", and also functions like "Walk", "Study" and "Speak". Then you can have another class for "Dog", with "Name" and "Age", but maybe not "PhoneNumber" and functions like "Walk", but not "Study" or "Speak". In this case, you can have a class called "LivingThings", which common properties like "Name" and "Age" and make "Human" and "Dog" class inherit those, which would be implementing an interface. Making your code easier to maintain in the long run. So, other than helping you write neat code, it would not add much to the table for what you want to do.

  7. #7
    EddieN1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2011
    Posts
    313
    Thanks for you responses. I guess a Class Module won't do what I hoped it might. Thanks for everyone's help. I guess this post is Closed.

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

Similar Threads

  1. Class module getting a 2046 error
    By GraeagleBill in forum Programming
    Replies: 13
    Last Post: 11-09-2021, 02:23 PM
  2. Replies: 7
    Last Post: 03-11-2020, 04:30 AM
  3. Initialization Module/Class
    By swalsh84 in forum Modules
    Replies: 1
    Last Post: 12-13-2014, 12:25 PM
  4. Replies: 2
    Last Post: 01-07-2013, 07:24 AM
  5. class module vs regular module
    By Madmax in forum Modules
    Replies: 1
    Last Post: 05-01-2012, 03:44 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