
Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Thank you both for the suggestions. I suspect I have no Control-L because I
work only with VB with Access, not the full program, but thanks anyway Tim.
And I haven
't bothered to learn how to use the locals or watch windows. Anyway, Dirk,
you said it could not be done, so I took Tim's suggestion and put breakpoints
on the first line of every procedure, function and event on that form and
found the problem. The answer surprised me.
The form is for employees and has an up and down arrow to move up the list
of managers and back down to where you started. However, at the top, where
the employee and the manager are equal, I disable the up arrow. When you
click on the disabled up arrow again the form header executes a tab to tab
one, not the next tab in the list. Well this moves the focus to the manager's
field, which was calling the function with what I thought was a wrong
variable. I reorganized the tab list so the up and down arrows are one and
two and now when you click on the disabled up arrow, it tabs to the down
arrow and the manager's got focus never executes. Problem solved be using a
lot of breakpoints and following the bouncing ball. Thanks for your help.
Regards,
Michael

Signature
Stamford, CT
> > The error is occuring in a function, but the function is programmed
> > properly. The value sent to the function is wrong. So I want to know
[quoted text clipped - 9 lines]
> Screen.ActiveForm.Name within the function to find out the name of the
> active form when the function is called. Does that help?
Larry Linson - 13 May 2007 15:59 GMT
> I suspect I have no Control-L because I
> work only with VB with Access, not the
> full program, but thanks anyway Tim.
What are you talking about? Do you have the idea that it would be better to
work with a Jet database from a VB program created with the separate VB
product? If so, you are dead wrong -- it would be different, but not
better. The object models of classic VB, VB.NET, and of Access are
different, but the core VBA language of both classic VB and Access is the
same VBA6.DLL. VB.NET is something quite different.
Unless you do almost no VBA at all, you'd be well-advised to learn the
things you mention not knowing.
You might even consider getting the free MZTOOLS, http://www.mztools.com,
and setting up standard structure for your procedures which stores the
procedure name in a variable, and including that variable on all procedure
calls. That way, you could stop within the called procedure, and always
determine "from whence you came". That's not as extensive as the call stack,
but useful if you don't want to learn/use the call stack.
Larry Linson
Microsoft Access MVP
David W. Fenton - 13 May 2007 23:34 GMT
> You might even consider getting the free MZTOOLS,
> http://www.mztools.com, and setting up standard structure for your
[quoted text clipped - 3 lines]
> whence you came". That's not as extensive as the call stack, but
> useful if you don't want to learn/use the call stack.
You could easily implement a class module to replicate the call
stack, such that you were recording the order of execution. Dunno
how you'd clear out the results after code finishes executing,
though.

Signature
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/