Learning Curve

K

krcmd1

I've been a duffer with Access for 5 years and would like to be proficient,
including VB and SQL. How should I go about trying to learn this stuff? The
books don't seem to be very helpful, especially with problem areas like

quotes or no quotes
bang or dot
which event to use as trigger for code

The books give me some idea for code, which then doesn't work, and then I
usually have to cry for help from the discussion group. There has to be a
better way.

Thanks

Ken Cohen
 
D

Dirk Goldgar

krcmd1 said:
I've been a duffer with Access for 5 years and would like to be
proficient, including VB and SQL. How should I go about trying to
learn this stuff? The books don't seem to be very helpful,
especially with problem areas like

quotes or no quotes
bang or dot
which event to use as trigger for code

The books give me some idea for code, which then doesn't work, and
then I usually have to cry for help from the discussion group. There
has to be a better way.

Thanks

Ken Cohen

What books have you read? I heartily recommend the _Access <version>
Developer's Handbook_, by Getz et. al,, from Sybex. There are versions
for Access 97, 2000, and 2002; editions after the 97 version are
two-volume sets. John Viescas' _Access 2003 Inside Out_, from Microsoft
Press, is also very good.

Since you mentioned it, I'll tack on my own stock explanation of the
"dot" vs. "bang" question:

--------- BANG (!) vs. DOT (.) ----------
It's not so much a question of one or the other being "proper syntax",
but that they mean different things that nevertheless almost always give
the same result. As I understand it, the bang (!) notation specifically
denotes that what follows is a member of a collection; in this case, a
member of the form object's default collection, the Controls collection.
The dot (.) notation denotes that what follows is a property or method
of the preceding object. That would logically make the bang notation
"proper" and the dot notation improper.

But wait. Wherever possible, Access makes the controls on a form and
the fields in its recordsource all available as properties of the form.
It also makes the fields of the recordsource available via the bang
notation. I'm not sure exactly how it does this; maybe if a name is
not found in the Controls collection it checks the Fields collection of
the form's recordset as a fallback position. So for most practical
purposes Me!ControlName and Me.ControlName evaluate to the same thing,
and the timing tests I've seen suggest that there is little to choose
between them as far as execution efficiency is concerned. I seem to
recall that there is a very slight difference, but I can't remember
which way the advantage lies, and it's not much. There's a coding-time
advantage, however, to using the dot notation, as it makes the
"intellisense" dropdown lists available. That's a strong argument for
using the dot notation, in my book.

But wait again! I said above that Access makes the controls available
as properties "wherever possible". There are cases where it can't do
that. Specifically, it can't do it when there is already a property of
the same name as the control in question. For example, if your form
"Form1" has a control or a field foolishly named "Name", currently
displaying the value "John Doe", then executing this statement in the
form's code module:

Debug.Print Me!Name, Me.Name

will print

John Doe Form1

in the Immediate Window. So you must be careful not to use any reserved
words or built-in properties as names for your controls, if you want to
use the dot notation to refer to them. But then, you should avoid doing
that anyway, as it tends in general to confuse poor Access.
 
D

Duane

A few versions back, the "Build..." command was available in the code builder
window. You could click your way to the proper notation for whatever object
you were referencing, without the risk of mistyping, or having to remember
all the brackets, dots and bangs, mes, and prefixes. I couldn't believe they
removed that, and never put it back since.
For a guy like me, who just writes a simple (and local) applet every couple
years, is there a simple way anymore to insert object notation, without
having to re-learn foreign conjugation every time?
Thanks,
--dg
 
D

Dirk Goldgar

Duane said:
A few versions back, the "Build..." command was available in the code
builder
window. You could click your way to the proper notation for whatever
object
you were referencing, without the risk of mistyping, or having to remember
all the brackets, dots and bangs, mes, and prefixes. I couldn't believe
they
removed that, and never put it back since.
For a guy like me, who just writes a simple (and local) applet every
couple
years, is there a simple way anymore to insert object notation, without
having to re-learn foreign conjugation every time?


I don't know, but I have noticed that often the expression builder will let
you build an expression that is syntactically correct, but which won't work
in the current context. I don't know how many times I've had to explain to
newsgroup posters that their expression was wrong, even though "I built it
with the Expression Builder!" So maybe Microsoft just decided that, rather
than trying to make the Expression Builder more context-sensitive, they'd
just remove it completely. Or, of course, the change could have been due to
the new structure of the VB project in Access 2000 and later, or any number
of other factors I'm not aware of.
 
D

Douglas J. Steele

Dirk Goldgar said:
I don't know, but I have noticed that often the expression builder will
let you build an expression that is syntactically correct, but which won't
work in the current context. I don't know how many times I've had to
explain to newsgroup posters that their expression was wrong, even though
"I built it with the Expression Builder!" So maybe Microsoft just decided
that, rather than trying to make the Expression Builder more
context-sensitive, they'd just remove it completely. Or, of course, the
change could have been due to the new structure of the VB project in
Access 2000 and later, or any number of other factors I'm not aware of.


It might be interesting to see whether MichKa's TSI Xpression (at
http://www.trigeminal.com/utility.asp?ItemID=1#1 ) is any better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top