By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,248 Members | 882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,248 IT Pros & Developers. It's quick & easy.

Something strange about Form_Current

P: n/a
In Access 97, in the Form_Current routine of a form, I call another
routine that repopulates and recomputes everything. However, a SQL
Select statement that I initiate from DAO that refers to a function of
mine errors out, claiming that the function does not exist. However, if
I move the call to that same routine to various places other than the
Form_Current routine, it works just fine! It appears that Jet/Access is
somehow unable to find functions in SQL statements if Form_Current is
anywhere in the call list!!!

Do you have ANY idea as to what might be happening here?

Thanks in advance for even your wildest ass of guesses.

Steve Richfie1d
May 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, 10 May 2006 16:38:13 -0600, Steve Richfie1d
<St***@NOSPAM.smart-life.net> wrote:

Here is a WAG: check the call stack when the error occurs. Perhaps
there is some unexpected recursion going on? "repopulates and
recomputes" could easily re-invoke the Current event.

Otherwise, use the proven debug technique of reducing the problem to
its essential components. You may then want to post that code here.

-Tom.
In Access 97, in the Form_Current routine of a form, I call another
routine that repopulates and recomputes everything. However, a SQL
Select statement that I initiate from DAO that refers to a function of
mine errors out, claiming that the function does not exist. However, if
I move the call to that same routine to various places other than the
Form_Current routine, it works just fine! It appears that Jet/Access is
somehow unable to find functions in SQL statements if Form_Current is
anywhere in the call list!!!

Do you have ANY idea as to what might be happening here?

Thanks in advance for even your wildest ass of guesses.

Steve Richfie1d


May 11 '06 #2

P: n/a
Tom,
Here is a WAG: check the call stack when the error occurs. Perhaps
there is some unexpected recursion going on? "repopulates and
recomputes" could easily re-invoke the Current event.
Everything was clean and as expected.
Otherwise, use the proven debug technique of reducing the problem to
its essential components. You may then want to post that code here.


I had pretty much done that to get it down to being the Form_Current event.

The quick-and-dirty fix (hold your nose!) that I just put in was to put
the call to the routine to repopulate and recompute things into the
timer along with a line to clear the TimerInterval, and set the
TimerInterval to 1 in the Form_Current routine to trigger the timer
immediately (in 1ms) following the Form_Current event. Of course I would
prefer to rip that mess out and "do it right" however that might be, but
at least I got the code running for now while I look for a better way.

Timers have long been used to cover problems with events, e.g. the lack
of an "Opened" event. The problem in Access (vs. VB) is that you only
get one timer per form, so you had better pray that you don't have more
than one such problem per form.

Thanks for taking a shot at my mess.

Steve Richfie1d
=======================
In Access 97, in the Form_Current routine of a form, I call another
routine that repopulates and recomputes everything. However, a SQL
Select statement that I initiate from DAO that refers to a function of
mine errors out, claiming that the function does not exist. However, if
I move the call to that same routine to various places other than the
Form_Current routine, it works just fine! It appears that Jet/Access is
somehow unable to find functions in SQL statements if Form_Current is
anywhere in the call list!!!

Do you have ANY idea as to what might be happening here?

Thanks in advance for even your wildest ass of guesses.

Steve Richfie1d


May 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.