R
Rick Brandt
ByB said:Hello,
I am working on a VBA Access pplication which connects to a SQL Server
database.
I have a continuous form displayed with data, ad it is linked to a
database table, so when I enter a value from my form the data in
instantaneously updated in the database.
The problem I have is that this form works perfectly when I am
developping, and using my developpement environement (with Access
allowing me to set breakpoints, go step by step in the code and so
on), but it does not work when I use it in the PC of the ending user
: in this case, when I enter a value in the form, and click in
another part of the form, it crashes immediately. Note that my ending
user has a version of Access which does not allow entering or
modifying the code, but just executing my application as a MDE
project.
So I made several tests, and the conclusion is that with a version of
Access which allows access to the VBA code (developpement version),
the form works (in MDB or MDE versions of the app), but not with the
version that does not give access to the code.
Is there something I should do when creating the MDE file to be sure
that it includes averything it needs to run correctly in all versions
of Access ?
What should I do to allow my MDE file to run in any version of Access
?
Thank you for any idea on this point.
First off, the "version of Access" you are describing that your user has sounds
like the runtime. That is a completely different and separate issue to using an
MDE. One can use an MDE in the fully licensed version of Access and one can use
an MDB with the runtime.
The reason I make that distinction is that it is possible for code to work in an
MDB and not in an MDE without bringing the runtime into the discussion and it is
also possible for code in an MDB that works in "full-blown" Access to not work
in the runtime. Lastly (and more likely really), is that it is possible for
code to work on one PC and not on another without the runtime or MDB/MDE being
thrown into the mix at all.
Whether the runtime, the MDE, the combination of the two, or none of those has
anything at all to do with your problem cannot be determined unless you post
exactly what your code is.
Generally speaking MDEs cannot execute code that would try to alter the design
of a code-based object or open it in design view. The runtime has some
restrictions on what you can do, but mostly from the user interface. The list
of things you cannot do with code is a pretty small list. Certainly anything to
do with saving a record should be just fine. A missing VBA reference is a
common problem when code works on one PC and not on another. Unfortunately,
that is not so easy to diagnose with an MDE or with the runtime.
You can certainly rule out the MDE factor by seeing if you have that problem
with the MDE on your development machine. If not, then you can likely dismiss
that issue. Additionally, you can launch your app from a shortcut that
specifies the /runtime command line argument for the Access executable to
simulate the runtime environment on your PC. If you don't see the same problem
then the runtime is likely not the issue.
After that I suggest posting your code. The answer might be obvious to someone
from there.