Recommended Reference Material?

RaunLGoode

Registered User.
Local time
Yesterday, 18:34
Joined
Feb 18, 2004
Messages
122
First, let me thank everybody out there for all the help I have received. I know your time is valuable
Second, I am trying to get my hands around “objects” better. So I don’t have to bother everyone with my rookie questions. As much as I benefit from the experience, I hate wasting everybody’s valuable time.

Can any of you recommend some good references I can use to self educate on VBA in general and “objects” in particular? I had a class at a local community college, but the instructor left much to be desired.
 
RaunLGoode said:
Can any of you recommend some good references I can use to self educate on VBA in general and “objects” in particular?

"Object" is such a nebulous term to begin with... It and its sister phrase, object oriented, confuse and discourage just about everybody, newbies and veterans alike. Better names for object might be CodeLoad, CodeBall, LoadOfCode, CodeToCall, CodeBlackBox, ToolBox, or CodeToaster.

One vital thing: you must have a firm grasp of functions and subprocedures and variables -- what they do, why they're important, how to create and use them in code -- before you'll be comfortable with objects under any name.

If you do have a firm grasp of functions and subprocedures and variables with some coding experience, I recommend Francesco Balena's Programming MS Visual Basic 6.0. It's not an Access book, though, so it may have only limited value to you. Perhaps you can stop in at your bookstore and browse, taking a peek at chapters 6 and 7. If you don't have a lot of code expereince, I would put objects on the back burner, coming back to it after you've built an app or two.

For Access VBA in general, probably the most recommended book is the Access Developer's Handbook, published by Sybex. Could be a bit much, though, if you're a beginner. You'll also find, as you build up your vocabulary (this is half the battle) and become accustomed to the syntax, that the Help file has quite a few good code samples.

Regards,
Tim
 
Reply

Thanks Tim,
Actually I support several different applications[PI (from OSI),AutoCAD and (of course)Excel] with VB6.0. That is, I would be able to support them if I understood VB better. Your first recommendation, Programming MS Visual Basic 6.0, may be right up my alley.
Between what I have learned from recording Macros in Excel, courses, and a few books I have picked up along the way, I have figured out that understanding objects/functions/subprocedures/variables is critical to doing what I want to do. I guess thats like saying" If I only knew how to write code, I could be a great programmer. I don't think I am that far from "getting it" and I see so many things I would like to do "post epiphany". I have learned that there are plenty of VB and OOP books out there, I haven't found one out there yet that really gets this concept across. and at $50 a pop I cant keep buying these until a find the right one.
I appreciate your feedback.
 
RaunLGoode said:
Thanks Tim,
I don't think I am that far from "getting it" and I see so many things I would like to do "post epiphany".

Faulkner said that writing is 1 percent inspiration and 99 percent perspiration. Writing code is similar, except it's probably .00001 percent inspiration...

My best advice: don't wait for or even expect an epiphany (I've had and forgotten just about all of mine). Simply keep moving forward with a programming project. Most people's "Now I get this" moment only comes after suffering through their first couple of sizable apps, after they've kicked the cat a few times, tossed a book, and flipped off their neighbors.

Balena's book is Intermediate to Advanced, so be careful with it -- it's not something to read cover to cover; it's better to use it as a reference to figure out how to do something specific. Good luck.

Regards,
Tim
 
G’day RaunLGoode

Maybe a little (very little) demo of objects might help.

Three classes are involved here…

The parent class, base class, is clsPoint and has four variables, only two of which are used in the demo: -
Private lngX As Long ' Horozantal.
Private lngY As Long ' Vertical.
Private lngZ As Long ' Depth.
Private datT As Date ' Time.

First child class, clsArea, inherits two Point classes as TopLeft and BottomRight.
It also has the ability to calculate its own area.

And finally clsRectangle inherits one class Area and has the ability to draw itself on a report.

In effect the Rectangle has inherited two class points which define the Top, Left, Bottom and Right along with the ability to calculate its area and adds the ability to draw itself on a report.

Perhaps there are two main things to look at here.
The first is the ‘scope’ of the internal variables and procedures; can they be ‘got at’ directly from outside the class? Answer…no, and that makes them safe.

The second is how a parent class needs to be as simple as it can be while still performing its function. It is the children that add to the functionality if and when it is needed.

So if you wish to have a play with it I would suggest trying to create a class called Circle, which inherits one Point class for centre, adds a radius variable and includes the ability to calculate its area and draw itself on a report.

Hope that helps or at least gets you started.

Regards,
Chris.
 

Attachments

Because of the time differences we could be here awhile.

There is an answer to the Circle problem in the attached demo.

That demo should not be viewed till you have an understanding of what went before or until you give up. (Even if you give up you will have to understand what went before, so if you want to do this thing…there is no point in giving up!)

The first demo introduced, in a limited way, the concept of scope and inheritance.
The second demo introduces the concept of the caterpillar turning into a butterfly.

See if you, or anyone else, can spot the ‘start’ of the butterfly.

Regards,
Chris.
 

Attachments

Well since the circle was posted I was going to ask about the exercise of producing irregular closed polygons.

However, it took more time than I thought it would so here is a crude example as it stands.

The top image is supposed to represent a wire-frame of a closed, stress relieved, five-sided polygon in 3D.
The bottom image is supposed to represent the same wire-frame of a closed polygon in 3D under some torque. (Top held with bottom twisted. Structural engineers please don’t laugh… I don’t know the math.)

Point is (pun intended) they are both the same object, passed different data.
(In other words, the object becomes reusable.)

Regards,
Chris.
 

Attachments

Irregular polygons are nice if somewhat troublesome.

The attached demo condenses some code, which makes it a little harder to read, but it should be worthwhile.

A table now exists to enable selection of the required graphic from a form; same report, different selection.

Need help with the math.
Lateral displacement due to torque on incompressible objects. (Should be easy for some.)
Lateral displacement due to torque on semi-compressible objects. (Should be a little more difficult for all.)

Please try to keep the math simple. I need an algorithm that contains the essence without the detail…I also need to understand it, which is a big ask. :o

Regards,
Chris.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom