473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

class module & continuous forms

Well I'm finally trying out class modules...I have a great book I'm
using but its ADO and I use DAO so it's a challenge for me...I've
looked most of today, in my book and here but can not find an answer.
Is it possible to use the class I've created to fill a continuous form?
Not finding any information leads me to believe that it can't be
done...
I have a continuous form that shows all invoices with a balance
due...I'm hoping to use the class to speed up putting all the data
together.... and I'm hoping to use it to fill a combo box...haven't
tried to find an answer on that yet.
Thanks in advance for any time and effort spent on my post.
Debbie

Nov 13 '05 #1
4 3008
>> Is it possible to use the class I've created to fill a continuous form?
No, not really. A class object is a "thing" of code.

A form is a "thing" attached to a table, and is for viewing data.

However, in code, you can often create sql, and use that for the source of a
form. So, you perhaps might make some class object that takes some
parameters, and then spits out some sql that can be use for the continues
form.

So, to fill a control, (eg: a combo box), or a form, you don't generally use
code to "make" the data. So, a class object is really of very little use to
"fill" a continues form.

where class objects tend to shine is when you got a CODING problem, and that
code starts to get very complex. So, use of your class objects will not
pertain much to the user interface in terms of providing data, but these
objects certainly allow you to "group" code and that object can also "hold"
data that the code needs. So, the "key" concept here is that often you need
code to work with some "data" and you also got "code" for that data.
However, this tends to be a coding issue, and not that of providing data for
a table, or in your case/question a form.

I talk about the "concept" as to "when" you would use a class object here

http://www.members.shaw.ca/AlbertKal.../WhyClass.html

To be fair, you certainly could write a class object that provides data for
a combo box. However, that ability would be based on the fact that you
"generate" the data that the combo box needs (that data would either be sent
to a table, or returned as a "value list" that combo can use, or the 3
possible way is to use a call back function. However, in all of these cases,
you can, and could use standard code in place of that class object.

So, the creating of a class object does not have some "extra" special
ability to fill a combo box,. That class object is simply witten with
regular VBA code.

The whole idea and use of class objects is that you can DEAL BETTER with
complexity in your code.

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #2
Albert D. Kallal wrote:
Is it possible to use the class I've created to fill a continuous form?

No, not really. A class object is a "thing" of code.

A form is a "thing" attached to a table, and is for viewing data.


Actually, a form has a Recorset property, which could be a table or query.

However, in code, you can often create sql, and use that for the source of a
form. So, you perhaps might make some class object that takes some
parameters, and then spits out some sql that can be use for the continues
form.
One thing I've done in the past is write a cheeseball query something
like this:

select * from oneofmytables where 1=0

Then I just push programmatically created/modified SQL into that query
as needed.

A form certainly could then be bound to this doppleganger query. When
it's opened (i.e., OnOpen event handler), it could call a class method
which sets the query to the right SQL, which then generates the
recordset for the form to be bound to.

The class doesn't have to know about the form this way.
So, to fill a control, (eg: a combo box), or a form, you don't generally use
code to "make" the data. So, a class object is really of very little use to
"fill" a continues form.
For a combo/list box, you sure can push your own list of values
programmatically into their lists.
where class objects tend to shine is when you got a CODING problem, and that
code starts to get very complex. So, use of your class objects will not
pertain much to the user interface in terms of providing data, but these
objects certainly allow you to "group" code and that object can also "hold"
data that the code needs. So, the "key" concept here is that often you need
code to work with some "data" and you also got "code" for that data.
However, this tends to be a coding issue, and not that of providing data for
a table, or in your case/question a form.
Well, they can also help to sort of isolate your business logic from
your interface layers, which is one thing that Access completely sucks
at (too bad tables & queries will never get their own VBA event handlers).
I talk about the "concept" as to "when" you would use a class object here
http://www.members.shaw.ca/AlbertKal.../WhyClass.html

To be fair, you certainly could write a class object that provides data for
a combo box. However, that ability would be based on the fact that you
"generate" the data that the combo box needs (that data would either be sent
to a table, or returned as a "value list" that combo can use, or the 3
possible way is to use a call back function. However, in all of these cases,
you can, and could use standard code in place of that class object.
The 4th way is to just use a query as an empty SQL shell, and
programmatically push SQL into the query's SQL property, and refresh the
list/combobox...
So, the creating of a class object does not have some "extra" special
ability to fill a combo box,. That class object is simply witten with
regular VBA code.

The whole idea and use of class objects is that you can DEAL BETTER with
complexity in your code.


Another idea is to encapsulate some behaviors that are not possible to
do, but the only real examples I've seen (Access Devloper's Handbooks,
et al) are creating "custom controls" for forms.

So I've decided that they're not very useful in Access.
Nov 13 '05 #3
Thanks Albert.
I have been to your website several times in the past and appreciate
that you have it. Your futher clarification here has been very
helpful.

Nov 13 '05 #4
Thanks Corey for your input also. All of this will help me get this
figured out.

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: WindAndWaves | last post by:
Dear All Can you tell me why you use a class module??? Thank you Nicolaas ---
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
3
by: Richard Hollenbeck | last post by:
I have the following query in my form's code: Private Function Get_Data(fieldNum As Integer) Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset strSQL = "SELECT & "", "" & ...
19
by: Jamey Shuemaker | last post by:
I'm in the process of expanding my knowledge and use of Class Modules. I've perused MSDN and this and other sites, and I'm pretty comfortable with my understanding of Class Modules with the...
3
by: Marina | last post by:
Ok here's my problem.... I have a custom dialog box that allows the user to enter information to run a Parameter Query. This works GREAT, but I need that query to show as a form, not just the...
2
by: panwala_bhavesh | last post by:
Thanks in advance... I have a form displaying the results of a query in a continuous form style. I want to be able to double-click on the key field of the form (a textbox, in this case a AssetID)...
11
by: isoquin | last post by:
Really, i've looked for the answer, but I must be missing some syntax somewhere... I have a popup calendar which is to be used across several forms. Each form will need the calendar to...
2
by: Kevin | last post by:
I want to use a set of check boxes to narrow down entries on a subform. I.e. a check box for black, red & green to describe the colors of a product. So a use clicks Black and only black products...
0
by: BillE | last post by:
I'm wondering how others have addressed UI requirements for Access-style continuous forms and sub-forms in a windows forms application (besides third-party products). Thanks Bill
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.