Problems with converted MDB

C

CPutnam

Hi, all. We have a database application created in Access 97 that we are
trying to convert to Access 2002. When I convert the file, it appears to go
without a problem. But when I try to run it, it gives me the error "The
expression you entered has a function name that CLS Access Toolkit can't
find." (CLSToolkit.mdb is the name of the .mdb file). An Autoexec macro
runs a function (and it is a function, not a sub) but when I call and step
through the function, everything goes fine.

I asked a colleague to do a conversion of the same application and then send
it to me. He was able to convert without problems and was able to do some
simple operations within the converted application. But when I copy it to
my computer, I get the exact same error I was getting when I converted it!

I have read and read and read the postings about this problem but just can't
find a good way to figure out what the problem is with my setup. I've read
people's comments about not using an Autoexec macro (but since my colleague
has gotten this to work without a problem...), something about a Sandbox
mode (which I didn't think applied to my version of Access), other things
about missing references (nothing shows as missing and I've compared my
references with my colleague and they are the same), functions and commands
with the same names (which seemed to have been taken care of in Access97 so
I don't think that's the problem), and a lot of other things, some of which
I didn't understand.

I'm running I was hoping that someone could give me a basic idea of "all"
the places to check to find possible discrepancies. I am about at the end
of my rope.

Thanks in advance. Carol.
 
A

Allen Browne

Does your code compile in the new database? From the code window, choose
Compile on the Debug menu.

What happens if you add
Stop
as the first line of your function?
When the database opens, the code will break there.
If it then continues okay, you have proved that you have a timing-sensitive
issue.

Here's a generic article on converting form A97:
http://members.iinet.net.au/~allenbrowne/ser-48.html
It include a reference to Sandbox mode, explains the problems with Name
AutoCorrect, and the importance of SP3 for Office XP and SP8 for JET4.

Here's a generic article on references:
http://members.iinet.net.au/~allenbrowne/ser-38.html
It is really important that you use the DAO 3.6 Library with A2002, not the
3.51 library you would have been using in A97.
 
C

CPutnam

Thanks, Allen.

Yes, my code compiled.

When I put Stop in as the first line of the function, I still get the error.

I'll read the articles you referred to and double check everything. I'll
keep the group posted.

Cross your fingers for me! Carol.
 
C

CPutnam

Hi, Allen. In my earlier reply, I meant to say that I get the same error
message and that because I'm running the Autoexec macro, it comes up with
the name of the function as the location of the problem.

So what does that mean?

Thanks again. Carol.
 
A

Allen Browne

Hi Carol

I don't know what's happening. If the application worked on your friend's
machine, but (with no changes) failed on your machine then something odd is
happening.

Presumably the function being called is in a standard module (not that of a
form), and has the word PUBLIC in front of the module declaration, i.e.:
Public Function MyFunc()

Is it possible that you have 2 things with the same name? What is the name
of your function?

If the function has any error handling (e.g. "On Error ...") comment it out
until you solve this.

As a workaround, create a new (blank) form, and name it as your startup form
(Tools | Startup). Use its Open event to call the function. If that works,
the problem is with the AutoExec macro itself.
 
C

CPutnam

Why do I always end up with the esoteric problems? ;-)

Anyways, I did create the workaround with a new form so I'm able to get into
the application. (Interestingly, I was able to create an Autoexec macro so
it opens the form. Then clicking the button on the form calls a generic
function that runs the steps that are normally run by the Autoexec macro.
BUT if I just put a RunCode command in the Autoexecc macro that calls the
generic function, I get the same error I was getting in the first place.)

(BTW since you asked -- The function originally called by the Autoexec macro
is called Public Function gfncStartupBeforeLogin(Optional ByVal fRestart As
Boolean = False). I can't imagine any internal function having that
name...) . When I comment out all the error checking in this function, I
still get the same error.)

I found something interesting which may be relevant to the whole problem --
Within the application there are buttons as well as custom menu items which
do the same thing (i.e. copy a query, filter a list, etc.). Whenever I
choose an item from the drop down menus, I get the same "cannot find
function" error. When I press the button that does the same thing, then the
code works fine and I don't get an error message. I know that the menus run
macros. I haven't checked them all but the ones that I have checked just
call different functions when clicked.

Since I'm getting the same error as I did when using an Autoexec macro to
RunCode, I'm wondering if all these macro problems are related. Does this
ring any bells with anyone?

Thanks. Carol.
 
C

CPutnam

GOOD NEWS -- I finally got this working but to do that I had to totally
uninstall Office XP and Office97 and then reinstall Office XP (and I'm not
going to touch Office97 until I'm sure that I can get this conversion all
worked out).

Thanks for your help, Allen. Carol.
 
C

CPutnam

Thanks but I don't think that was the problem. Two reasons: Once I
reinstalled Office XP, my application worked. And the application's creator
was very good about his naming -- all the modules were called basxxxxx and
the functions had names like gfncFunction().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top