Now for the square brackets.
This one is a bit more difficult as there are variations to the rule.
It is generally used in conjuction with the name of an object.
For example, the name of a field in an sql query
-
SELECT FieldName FROM TheTable
-
Notice there are no square brackets around anything.
If however my personal naming convention separated words with spaces instead of capitalized first characters.
-
SELECT Field Name FROM The Table
-
This would not work because Field and Name would be considered as two fields and there is no comma between them. The query would also look for a table called The.
Table would be considered as erroneous....incomprehensible nonsense.
You must write the query then, like this
-
SELECT [Field Name] FROM [The Table]
-
The square brackets forces the two words, Field Name, to be read as one field.
Get it?
As mentioned, there are variations to the use of [] but they all exist for similar reasons.
Incidentally, this
-
SELECT [FieldName] FROM [TheTable]
-
is not wrong, just unnecessary to include the [] here and therefore, that is the reason they are sometimes there and sometimes not.
I hope that helps a little. Spelling all this out in a tutorial can make for incredibly boring reading and in reality is probably better gained through experience and asking (specific) questions. It is a long road but the journey is very satisfying even if sometimes frustrating.
At least... it is for me.
EDIT
My anti tutorial comment is directed more towards things like
when to use [] and when not to.
It is not intended as a slurr against "VBA Basics" tutorials