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

Compile error causes MDE creation to fail in A97???

P: n/a
MLH
A97 aborts creation of MDE reporting that there's a compile
error in one form. Sure enough, if I remove the form from the
source database and attempt to compile the MDE, it succeeds.

But when I open the source MDB file and the form's class
module, click Debug, Compile Loaded Modules - no compile
time error is reported. What is the MDE doing to find a compile
time error that Debug/Compile Loaded Modules is not?

If you've encountered and overcame this obstacle in the past,
what did you determine to be the culprit?
Nov 25 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Try a decompile.

Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact the database:
Tools | Database Utilities | Compact

If that does not solve the problem, copy the code from the form's module
out to a text file and save it. Then set the form's HasModule property to
No, so it loses the code. Compact the database. Then export the form itself
to a text file with this undocumented command:
SaveAsText acForm, "Form1", "C:\Form1.txt"
Delete the form. Compact again.
Then import the form with:
LoadFromText acForm, "Form1", "C:\Form1.txt"
The paste in the code, and try a Compile All.

If it's still stuck after this, is there any code in the form that alters
its RecordSource or writes the SQL of its source query? If so, or you have
any code that refers to a field in the form's RecordSource that is not also
the name of a control on the form, try using a bang instead of a dot when
referring to that field in your code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:hu********************************@4ax.com...
A97 aborts creation of MDE reporting that there's a compile
error in one form. Sure enough, if I remove the form from the
source database and attempt to compile the MDE, it succeeds.

But when I open the source MDB file and the form's class
module, click Debug, Compile Loaded Modules - no compile
time error is reported. What is the MDE doing to find a compile
time error that Debug/Compile Loaded Modules is not?

If you've encountered and overcame this obstacle in the past,
what did you determine to be the culprit?

Nov 26 '05 #2

P: n/a
MLH
Thank-you Allen. What I did was to go to an earlier
(previous) rev and use the copy of the form saved
there. I copied ALL the form's code from the later
rev into the earlier rev. Fortunately, none of the
form's controls had been modified, renamed nor
no new one's had been added. Afterward, the
make MDE process was flawless. TGBF.

I kept a copy of the database with the flawed
form and I will go back to it sometime and test
your suggestions. They seemed like good ones.

BTW, is /DECOMPILE commandline option one
of those where I should go RTMFHF as some
suggest here?
Nov 26 '05 #3

P: n/a
You can find many references to /decompile by a search on google.
--
Terry Kreft

"MLH" <CR**@NorthState.net> wrote in message
news:6b********************************@4ax.com...
<SNIP>
BTW, is /DECOMPILE commandline option one
of those where I should go RTMFHF as some
suggest here?

Nov 26 '05 #4

P: n/a
Access keeps 2 copies of your code:
- the text you read and edit;
- the compiled code that runs.
If the 2 versions are out of sync, you have a corruption.

Decompiling discards the compiled version.
Access automatically recreates it.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:6b********************************@4ax.com...
Thank-you Allen. What I did was to go to an earlier
(previous) rev and use the copy of the form saved
there. I copied ALL the form's code from the later
rev into the earlier rev. Fortunately, none of the
form's controls had been modified, renamed nor
no new one's had been added. Afterward, the
make MDE process was flawless. TGBF.

I kept a copy of the database with the flawed
form and I will go back to it sometime and test
your suggestions. They seemed like good ones.

BTW, is /DECOMPILE commandline option one
of those where I should go RTMFHF as some
suggest here?

Nov 26 '05 #5

P: n/a
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in
news:43***********************@per-qv1-newsreader-01.iinet.net.au:
Access keeps 2 copies of your code:
- the text you read and edit;
- the compiled code that runs.
If the 2 versions are out of sync, you have a corruption.

Decompiling discards the compiled version.
Access automatically recreates it.


But you should control when it recreates it as much as possible.

This means that you should set your options so that COMPILE ON
DEMAND is turned OFF (it's on by default). You'd think this would
cause problems, but it won't. If you look at the help file on the
VBA options you'll find a discussion of how these work, and it
explains why turning off COMPILE ON DEMAND doesn't really stop
Access from compiling code when it needs to. What turning it off
*does* do is reduce the number of times code gets compiled.

I am in the habit of hitting compile and then SAVE frequently when
in the code window (this is especially important with A2K+, where
otherwise it's easy to lose code changes). I don't let Access do the
compiling, except when I forget to do it myself.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 26 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.