Lyle Fairfield <ly***********@ aim.comwrote in
news:Xn******** *************** **********@216. 221.81.119:
"Larry Linson" <bo*****@localh ost.notwrote in
news:3GtCg.4236 4$gU4.39878@trn ddc07:
>I have a colleague who occasionally hires subcontractors to do
Access work. He invariably includes as one of his "do-or-die"
questions: "How do you pass information to a Form that you open
with DoCmd.OpenForm? " or "What is OpenArgs?"
I haven't used OpenArgs for many years and I wouldn't suggest that
it's the way I would pass information to a Form that I open.
I would open the form with
Form_FormName.W hateverProperty = WhateverInforma tion
or if there were mucho stuff to pass I would set a reference to a
new instance of the form.
That would work, I suppose, for forms not opened modally, but if the
form is modal, it would have to have the information set up for it
before it opens.
I tend to use class modules as data storage structures for this
purpose, but one could use any number of structures for the same
purpose. I hardly ever use OpenArgs for this purpose in my recent
work (i.e., in the last 5 years).
I guess this explains why I am unemployed.
It all depends on what the person asking the question expects as an
answer. I'd give OpenArgs as a possibility for the very simplest
circumstances, but would allow that if you need to pass more than
one parameter, you end up having to parse the string you've passed
in and then it becomes pretty ugly, so at that point I'd go to some
kind of independent data structure.
Of course, I also have a preference for passing *no* information at
all to dialog forms, since so many of them that I use need to be
used in multiple contexts, so that's the ideal, a form that doesn't
have to know anything at all about anything outside itself. But, of
course, that's not always possible.
But that's the kind of answer I'd given.
If it would get me tossed from the job, I wouldn't want to work for
the guy, because anyone who wouldn't consider that kind of answer to
be sufficiently detailed is not someone I'd want to work for.
--
David W. Fenton
http://www.dfenton.com/
usenet at dfenton dot com
http://www.dfenton.com/DFA/