On Feb 12, 7:03*pm, "David-W-Fenton" <NoEm...@SeeSignature.invalid>
wrote:
> 0 1 <hhholme...@gmail.com> wrote innews:893da083-ef45-43b1-9021-(E-Mail Removed)
> m:
>
> > * * ' this line makes Dirty = True for all click events on the
> > * * form
> > that opened
> > * * Forms(stDocName).Controls("PatientID").Value = Me.Parent!
> > PatientID
>
> Yes, of course it dirties the form whose name is stored in the
> variable stDocName.
I see why it would dirty it upon opening, but once the form is open,
this code is over isn't it? How does it permanently create a scenario
where any click even on the opened form dirties the record?
> Is it possible the recordset is looking up the
> wrong record and assigning the wrong form name to that variable?
The correct record and correct form seem to always be assigned.
> Looks like very strange code to me. I don't see why you couldn't
> have a saved QueryDef that's the same as the recordset without a
> WHERE clause, and then use a DLookup() to get the value you need.
> Even if I were going to do it with a recordset, I'd never use ADO
> for something like this -- it's simply completely unnecessary to use
> anything other than DAO.
I completely agree. I inherited much of this code, and because there
was so much of it I've tried to work with it rather than rewrite. But
so much of if seems unnecessarily complicated and, for lack of a
better word, long-winded.
> --
> David W. Fenton * * * * * * * * *http://www.dfenton.com/
> contact via website only * *http://www.dfenton.com/DFA/