Education, Education, Education............????

bluenose76

Registered User.
Local time
Today, 21:47
Joined
Nov 28, 2004
Messages
127
Gentlemen,

I have written a few db to date and all of them are woking fine and acheive exactly what it is that I wish them do which is great.

Many times have I had to refer to this site and must say that each time I have received superb advice and assistance which is great.

The reason for my post today is because I have concluded that in order for me to take my skills further, I really need to get my head around the world of VBA! to that end, my question to the forum today is:

What is the best route to take and where should I start if I wish to learn the art of VBA?

any and all advice is much appreciated.
 
Blue,

I started learning it on my own when I became fascinated by it. I really couldn't stay away from it, which is really what you need (interest) if you are going to retain any information you pick up. I was actually pretty good at writing syntax before I ever bought a book on it, and quite frankly, I think I've used KB articles from Microsoft and the Access help menu more than I have the books! What I did like about the them though, was using the simple terms in them to interpret the "technical jargon / lingo" that I didn't understand when I had to read it (like the code from MS KB's).

The art of it is all about you. There are many ways to do a lot of different things with the language, but there is only one way to do every one thing in a simple and efficient manner. If you really want to understand what the language is all about, I would say the most important thing is being able to distinguish between the different building blocks of it. These would be concepts such as properties, actions, commands, objects, references, arrays, variables, declarations, error handing, code sequencing, etc, etc...

That is just some of the "lingo". After doing it for a while, you might find yourself speaking with those terms, and then you'll start thinking like a programmer, bogged down all day long with logic on the brain. :) If you seriously want to learn the language, I would buy at least one book at a book store. I live in the states, and we have Barnes & Noble in my area. I have 2 books specifically on Visual Basic and 1 book strictly related to Access and its version of VBA.

From my own experience with it, I can tell you that it sure is worth while to consider. When I decided to master it, I remember learning the general syntax of SQL, then short references to forms (Forms!Form!Control). When I started trying to write modules and form events, my progress halted for about a month, because I had to learn the tough concepts and experiment with the program OVER and OVER and OVER again. :) When I got to the point where I was writing functions with 3 to 4 subroutines and calling them on condition from different areas of the database, I knew I was at least somewhat knowledgeable! But then again, I had started figuring this out when I noticed that I was writing blocks of code with 5 subconditions in them. I can't believe I have gotten this far really, but it's from pure ambition. I can pretty much control an entire database now just by writing Visual Basic, and not having to mess with the GUI. That's not practical, but it does show you how far you can go if you want.

Anyway, that's my life story from the programming world. I hope you enjoy learning it as much as I did!! :)
 
Last edited:
I had great difficulty finding out anything about VBA. Lots of sites make reference to it some even show code examples, but because VBA is so broad it's difficult for anyone to be specific unless you give them something to work with.

The best way to learn is to start with easy stuff. Create a button on a form, use one of standard ones and then go to the code and watch what it does with it.

However, in my opinion wizards write bad code (too wordy), but at least this is a start.

The next best way is forums like this. Ask a question. Don't be embarassed we all started somewhere.
 
in my opinion wizards write bad code (too wordy)
that's a popular opinion zaphod, but unfortunately the wizard was designed by the same person who wrote the program. And yes, it is annoying, and cumbersome, but in terms of the language, it makes perfect logical sense. That's probably why it's not very popular!! :)
 
I already knew how to program when I took up Access. I had worked with COBOL for over 20 years. My biggest hurdle was getting a grip on the object model and how form and control events worked. The book I found most useful in the beginning was the Access Cookbook which I think is in its third version. It is a good book if you can learn by example. If you want to learn how to program, I have heard good things about Code Complete. Rather than concentrating on a particular language, it teaches concepts and good practice.
 
Thank You

Gentlemen, Thank you for your advice.

I have many times asked for help on this very forum, and am please to say that each and every time i have received the help which is great.

The code examples have helped me several times but i was finding that although my db works, i was not writing the code myself hence my question now.

I will take a look at the access cookbook and see how i get along with that. does anyone know of a Access VBA book written by MS Press? if so what you think?

once again thank you for your advice.
 
You can find a language reference which lists all the elements of the language but that won't teach you how to program. Syntax can be easily obtained from help so this type of book isn't as useful as one that talks about style and structure.
 
In the final analysis, most of us learn by observation. (It is an offshoot of Mankind's evolution as a visual animal.) So of course, Visual Basic should be right up our alley!

The place to start is to look at samples and snippets of code to which you have some access. Like the VBA code in the example databases that come with Access. Use the wizards to create button events. Learn to look at the code with a critical eye because the wizards are dumber than a box of rocks, but the darned wizard-generated code WORKS.

If you think about it, every textbook you've ever read has a lot of words, but the good ones also have lots of pictures, diagrams, and examples. Why? Because we learn by seeing how others approached problems.

When you are ready for a little bit more advanced reading, try Access 2003 VBA Programmer's Reference (WROX publisher) by Cardoza, Henning, Seach, and Stein. I won't say they are perfect, but they have some extensive samples to look at.

If you have exposure to any other computer language, you have a leg up on most of the beginner Access users. Because you would then be familiar with the all-too-frequent need for conversions. Back when I was still in college, one of the pioneers of the computer industry did a study. Came to the conclusion that 30% of all programs are merely instructions to MOVE or COPY or REFORMAT something. (I.e. not a formula or comparison or lengthy computation.) So a good subject to study is conversions. Here, the CStr, CDbl, CInt, etc. are good functions to know.

Eventually you will start to recognize that the problem with the wizards is that they are designed in a way that is unlikely to fail, not because they are elegant, but because they don't do anything risky or tricky. They don't go for "clever." They go for "getting the job done." Nor can I say that is a wrongful viewpoint.

In my career I have supervised many good programmers. Like ALL persons in ALL fields of endeavour, they learned by example, by LOOKING at how others do things. So look at the wizard code and the example code and code snippets where you find them.
 
that's a popular opinion zaphod, but unfortunately the wizard was designed by the same person who wrote the program. And yes, it is annoying, and cumbersome, but in terms of the language, it makes perfect logical sense. That's probably why it's not very popular!! :)

Perhaps I should have said a little more.

I totally agree, but then again most wizards I have used write annoying code.

I must admit that sometimes when I'm writing a quick and dirty form, the wizards can be a godsend. Attach button, assign purpose et viola done.

However, they are also a good way to learn how not to write compact code, but like everything else, they are merely a tool and should not be the be all and end all of any coding.
 
Found the good resource of starting out, I'll try to apply it one at a time.:D

 

Users who are viewing this thread

Back
Top Bottom