Is this a good start to learning VBA? (1 Viewer)

Umpire

New member
Local time
Today, 14:35
Joined
Mar 24, 2020
Messages
14
I found a PDF of the book "Access VBA Programing for Dummies" by Alan Simpson, on line.
I was wondering if that is a good place to start to learn VBA in general and VBA for Access in particular.

Thoughts?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:35
Joined
Feb 19, 2013
Messages
12,092
It's as good as any - When I first started (many years ago and before the internet) I read the book from cover to cover. Much did not make sense at the time and more I did not remember the detail. But I'd remember some key words/phrases so when I actually tried to do something I would remember I had read something about it - just had to find it!

Always worth having a project in mind when reading it so you can get something in your head about how the examples might apply.
 

Umpire

New member
Local time
Today, 14:35
Joined
Mar 24, 2020
Messages
14
Thanks. I do have a database that I am working on. It is doing a few things I want to change and don't know how. When I asked here, the answers were in VBA. I found a workaround for now but I need to understand VBA to figure out the "right" way to do things.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:35
Joined
Feb 19, 2002
Messages
28,764
My favorite was the Access Cookbook by Getz, Litwin, & Baron. It isn't a language manual. It is a learn by example tool. It picks things you commonly want to do and offer. The book predates A2007 but little has changed in VBA since then. Some of the examples are no longer important because Access now includes those features.
 

missinglinq

AWF VIP
Local time
Today, 17:35
Joined
Jun 20, 2003
Messages
6,360
...I was wondering if that is a good place to start to learn VBA in general...
There really is no VBA in general! VBA is actually a group of languages...VBA for Access is different than VBA for Excel.

And to make matters worse...Access has many Properties and Functions with the same names as Properties and Functions in Excel...but they often perform different tasks and are implemented differently!

Just something to keep in mind.

Linq ;0)>
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:35
Joined
Feb 19, 2002
Messages
28,764
VBA is an embedded language. The basics are the same in all implementations but each time it is embedded into an application, new objects, properties, and methods are defined that work only in that product. All the Office products support VBA for their own objects. MS even sold VBA to other companies so you might run into some other application that has VBA as its embedded language.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 17:35
Joined
May 21, 2018
Messages
3,139
Are you a book person, video person, guided lessons? I am a book person and you can go and buy older Access books on line for a couple of bucks. A lot of these books were 50 -100 dollars new. If videos is your thing there are just a ton of videos on line. A lot are garbage, but some are good. There is another thread somewhere that lists a lot of good resources for videos and on line courses.
 

The_Doc_Man

Happy Retired Curmudgeon
Local time
Today, 16:35
Joined
Feb 28, 2001
Messages
16,796
Linq, not to start a huge argument here, but VBA for Office is VBA for Office regardless of which Office utility you are using. I remember getting into a discussion on this forum about four or five years ago that related to the fact that if you "diddled" with the VBA display settings for Excel or Outlook, the changed settings showed up in Access too, even if you had not changed VBA settings within the context of Access. VBA is an add-on feature just like MSCHART is an add-on. Have you ever wondered why you have to open a separate child window in Access to design & compose VBA code even though you can design tables, queries, forms, and reports in different tabs in the same child window for the other parts of Access?

Don't confuse the language itself with the Object Model that lives with it. Granted, every Office utility has different objects and they drastically change the way things look. However, I don't think that the underlying syntax changes from utility to utility and that is because I think that VBA is the same separate entity for everything that uses it. What you can't do (or at least I've never found a way to do it, not that I've tried very hard) is open VBA in the absence of some other element of Office as its "operational base."
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:35
Joined
Jan 20, 2009
Messages
11,932
Don't confuse the language itself with the Object Model that lives with it.
Absolutely agree. Some developers struggle because they are overwhelmed by the object models that blinds them to the programming structure.

VBA is a very simple procedural language consisting of commands, conditional processing and loops.
Most of the rest of it is about addressing the members of the objects and assigning them to variables or vice versa.

You can move into constructing your own objects later but they are not essential.

In the end all programming languages are really much the same. They differ in the syntax of the assignment, conditional processing and loops.

Object oriented languages embed all the commands into the objects.
 

isladogs

CID Moderator
Staff member
Local time
Today, 22:35
Joined
Jan 14, 2017
Messages
13,161
Although I did use books, I learned mainly by studying the code in working databases.
Suggest you study some of the examples in Sample Databases and the Code Repository
If you do like learning from videos, I recommend the complete set of over100 free videos by Steve Bishop that cover everything from beginner level to advanced
 

SurreyNick

Member
Local time
Today, 22:35
Joined
Feb 12, 2020
Messages
86
As a fellow newcomer to VBA, which for me has quickly become essential knowledge, I found VBA for Dummies a very useful resource except for the section on recordsets which uses ADO technology exclusively and doesn't cover DAO. I also found the book a bit limited in terms of its examples, but I guess you can only include so much in a volume of this type and size. All-in-all though I learned a lot from it and as you say, it's free!

If you want something a bit more comprehensive I can also recommend Access 2010 VBA Programming Inside Out by Andrew Couch, but you might want to wait until you've done VBA for Dummies back-to-back first. I also echo what isladogs says about the Steve Bishop series of Access vids. I have watched the ones on VBA and SQL and they are very clear.
 

isladogs

CID Moderator
Staff member
Local time
Today, 22:35
Joined
Jan 14, 2017
Messages
13,161
In my opinion, the best ever Access books are the two volume set Access 2000 Developers Handbook by Litwin, Getz and Gilbert.
Although long since out of print, second hand copies can be found fairly cheaply.
However it is intended for advanced users
 

SurreyNick

Member
Local time
Today, 22:35
Joined
Feb 12, 2020
Messages
86
In my opinion, the best ever Access books are the two volume set Access 2000 Developers Handbook by Litwin, Getz and Gilbert.
Well you weren't wrong in advocating these volumes. Always on the lookout for good material I bought both volumes for under £15 delivered and they are extremely comprehensive, thorough and well laid out. I'm only ever likely to make use of a tiny proportion of the content, but nevertheless worth every penny!
 

isladogs

CID Moderator
Staff member
Local time
Today, 22:35
Joined
Jan 14, 2017
Messages
13,161
Excellent. Hope you find them as useful as me.
Out of interest, did your copies of the books include the CDs that came with each volume?
I ask as I don't have the CD for book 1.
 

SurreyNick

Member
Local time
Today, 22:35
Joined
Feb 12, 2020
Messages
86
I think I might.
Yes, I was lucky enough to get the CD with both books!
N.
 

jdraw

Super Moderator
Staff member
Local time
Today, 17:35
Joined
Jan 23, 2006
Messages
13,097
Tony,
I get nothing at the link?? No error, no data-- blank screen (using Firefox) - no message
UPDATE:
My mistake --no activity on the screen --but the pdf is in my downloads folder??
 

strive4peace

AWF VIP
Local time
Today, 16:35
Joined
Apr 3, 2020
Messages
482
Welcome Umpire!

here are 2 more links you can add:

Access Basics
http://www.accessmvp.com/strive4peace
Free 100-page book that covers essentials in Access

Learn VBA
http://www.accessmvp.com/strive4peace/VBA.htm

However, as mentioned, VBA itself isn't difficult -- learning the object model is what takes a lot of time!

press F2 in a code window to View the Object Browser
or, from the menu --> View, Object Browser

change the library to "VBA" (for instance, instead of <all libraries>) and look at the classes (categories) of functions -- click on a class and then click on a function in the right pane. To get the help for that function, press F1

The VBA library is the most basic library and a great place to start exploring.

to lookup properties and methods for different objects like forms, tabledefs, etc, change the library to Access

for recordsets, try the DAO library

explore the different libraries you have to pick from and see what is available in each

when you are in the Object Browser window, the library that each function/class is a member of is shown in the lower left corner of the window

the Object Browser is a GREAT way to learn

when you have an object selected, press F1 to get help. (also when you press F1 in code on a keyword, you go to Help)

~~~

The VBA code posted here has explanations and links to relevant Microsoft help, so it also would be a good way to learn.

http://msaccessgurus.com/code.htm

I started using Access almost 3 decades ago ... and am still learning! It is a powerful application you can do a lot with!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom