Question about class modules

J

John

I am experimenting with class modules as my database is becoming a bit
unwieldly using just bound forms. I can create a class module for an object
such as Invoice which uses fields from several tables. However, I wonder
could anyone tell me what is the usual method to use if the results from
several invoices are required.
For example if I set up the let and get properties for the invoice I can
call all details for a particular invoice by passing in the invoice number
or the invoice id (pkInvoiceID). But if I want a group of invoices for a
particular customer or between two dates, what is the usual method used to
do this.

Thanks
John
 
J

Jeff Boyce

John

Have you considered using a query to collect the information from several
tables together for all records belonging to a particular customer? You
could then use the query as the source for a report.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

Albert D. Kallal

Using class modules to replicate the basic editing abilities of a form is
generally not going to yield you anything much in terms of a better
application.
if I want a group of invoices for a particular customer or between two
dates, what is the usual method used to do this.

For the above you usually write a query. A class object will not help this
at all.

You have to use MUCH caution when building a form and using a lot of code
(class objects). The reason is then you commit yourself to grabbing results
from he data, and depending on code. However, with reports, and sql, you
don't have that ability.

So, for the most part, if your designs venture OUTSIDE of a relational data
designs that can't be solved with sql, then the class objects can be great
for the form, but your reporting and query will be EXTREMELY difficult.

I give my thoughts on *when* is a good idea to use class objects in
ms-access here:

http://www.members.shaw.ca/AlbertKallal/Articles/WhyClass.html
 
M

mcnews

Using class modules to replicate the basic editing abilities of a form is
generally not going to yield you anything much in terms of a better
application.


For the above you usually write a query. A class object will not help this
at all.

You have to use MUCH caution when building a form and using a lot of code
(class objects). The reason is then you commit yourself to grabbing results
from he data, and depending on code. However, with reports, and sql, you
don't have that ability.

So, for the most part, if your designs venture OUTSIDE of a relational data
designs that can't be solved with sql, then the class objects can be great
for the form, but your reporting and query will be EXTREMELY difficult.

I give my thoughts on *when* is a good idea to use class objects in
ms-access here:

i agree with the above.
it was fun figuring out how to keep it all together and make it work
in access, but i don't see any real reason to use class modules in the
way you describe with ms access.
 
A

Albert D. Kallal

mcnews said:
i agree with the above.
it was fun figuring out how to keep it all together and make it work
in access, but i don't see any real reason to use class modules in the
way you describe with ms access.

As mentioned, when you have a lot code that manipulates the data, then a
class object really does help.

A few of my applications have difficult levels of UI and very complex data
structures.

I have to go about 3, or 4 forms deep in terms of prompting the user, and
thus I use a class object to "gather" all that input information from the
user. This complex user input is then used passed "back" through all the
forms (in each form I declare an instance of this booking object). Then,
when the user is done, those forms close, and the data gathered is used to
create a booking.

In my above process and example, it is HUGE help in terms of the software
development process.

Just pulling, or grabbing values that can easily done in a form as mentioned
don't help a lot...
 
J

John

Albert D. Kallal said:
As mentioned, when you have a lot code that manipulates the data, then a
class object really does help.

A few of my applications have difficult levels of UI and very complex data
structures.

I have to go about 3, or 4 forms deep in terms of prompting the user, and
thus I use a class object to "gather" all that input information from the
user. This complex user input is then used passed "back" through all the
forms (in each form I declare an instance of this booking object). Then,
when the user is done, those forms close, and the data gathered is used to
create a booking.

In my above process and example, it is HUGE help in terms of the software
development process.

Just pulling, or grabbing values that can easily done in a form as
mentioned don't help a lot...

Sorry for delay, I was away for a few days
Thank you all for your help

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top