Thelma Lubkin wrote:
Lyle Fairfield <ly***********@aim.com> wrote:
: me.num
: means
: I can't feel anything in my butt
: or
: I have a form with a control called num on it
: me.num = DBEngine(0)(0).OpenRecordset("SELECT MAX(num) FROM
: mytable").Collect(0)
Thanks: you've got most of the tangles. But is DBEngine(0)(0)
different from 'me' in this context?
Very different:
DBEngine is the top level object of DAO. DBEngine(0) is the first
Workspace. DBEngine(0)(0) is the first Database of the first Workspace.
This should be your Database, the current Database, unless you have run
some very bad wizards which may make themselves DBEngine(0)(0). Many
developers use CurrentDB instead of DBEngine(0)(0) to avoid this
problem. Others, like me, never use wizards, at least not knowingly, or
without a struggle, or unless they are wizards we are convinced are good
wizards.
Me refers to the current class object (form or report), or class, that
is the object where the VBA code in which Me is written. In this case,
Num is a Control, Let Property or Modularly-Scoped Variable of the
current form or report, or Let Property or Modularly-Scoped Variable of
the currently running class.
What the code probably does is look up the maximum value of Num and show
it in a form control called Num.
Thelma I've seen a few posts from you. They were clever and
knowledgeable. One of these is true:
You already knew all this and much more and were just asking to see
where this might go, or for clarification;
Your learning has progressed much further in some areas than others;
I am mistaken about what I read.
In any case there will be a test on Friday.