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?
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?
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.
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?
IMO not, a class module is only a very structured way to write your code
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
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.
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.