473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3065
>> 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 programmaticall y 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
programmaticall y 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
programmaticall y 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
4999
by: WindAndWaves | last post by:
Dear All Can you tell me why you use a class module??? Thank you Nicolaas ---
4
7022
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 user enters the last qualifying field on the main form. In one case this works fine, the subform shows the data the user wants to update -- which means showing all the data put in previously (ie showing this via the requery and the continuous...
3
6671
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 & "", "" & AS Student, activities.activityDescription, studentScores.score FROM groups INNER JOIN (students INNER JOIN (activities INNER JOIN studentScores ON
19
4922
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 exception of custom Collection Classes. Background: I'm developing an A2K .mdb to be deployed as an .mde at my current job-site. It has several custom controls which utilize custom classes to wrap built-in controls, and add additional functionality....
3
1557
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 basic query screen. I have created the form, but how in the world do I get it to open based on the parameter query created by the user. Ugg... ok now even I'm confused... what a tangled web we weave... GRRRRR
2
2406
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) and use this to populate the AssetID textbox of another form. Any ideas on how to link these? Thanks! Bhavesh
11
4511
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 automatically enter the selected date into the designated textbox (this part works beautifully already) and then update the filter on a continuous form to include that date range. Now, I have several forms which will be in need of this popup calendar, so...
2
1624
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 are shown, the click green and only black and green products are shown. There will be a large number of choices that a user can make so I'm wondering... can I right a bit of code or function and put in a seperate module to call from an after...
0
1171
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
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10247
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.