Runtime not running VB code

  • Thread starter Thread starter bao371
  • Start date Start date
B

bao371

I have created a small database and have some standard buttons for printing
searching and such. I also created a button to toggle view and hide a list
box. Everything works great until I create the mdbde file then all the
buttons stop. I was getting the securty error and I would click enable, This
still did not help. I went in and certified the folder that the database is
in and now I do not get the securty message when I run the full blown
database but buttons will still not work with the runtime version.

I need help please.
 
Is this Access 2007? If so, this may be another that's on my long, long,
long list of A2007 bugs. Basically it seems that it silently fails to
compile when you generate your "e" file, I've had it happen a lot.

If it's what I've encountered, it can be fixed like this:

1. Open the database.
2. Open the code window.
3. Compile the database.
4. Switch back to the main window.
5. An object (probably a form which you have recently been working on) will
have mysteriously opened in design view.
6. Close that object, saving if prompted.
7. Compile again.

Should be OK now, *if* it's the same problem I've encountered. Failing
that, hit it with a big stick by creating a new file and importing all the
objects into it.
 
To answer your question, yes this is a 2007 access DB. To answer your post,
you were exactly correct. I followed you suggestion and it worked perfect.

Thank You Very Much
 
FYI, regardless of version, if you create an mde with VBA code that has any
compile errors, it probably will exhibit this behaviour. A compile followed
by a compact repair is always advised before creating an mde or an accdb
 
No, that's not true at all, this is a "new" bug in A2007.

If there is a compile error, then A2007 declines to create the "e" file,
just as previous versions always have. In the problem which the OP and I
have experienced, the "e" file gets created but without any working code,
and no errors or problems are raised by A2007. You don't know that anything
has gone wrong until you actually try to use the resulting "e" file.

No code changes are necessary to fix this problem, because there is no
compile error. All that is necessary is to follow the procedure I gave:
find out which form Access barfs up when you compile the project, and then
close/save it.

This is not a behaviour I have seen before, in 10 years of creating mde's.
Fortunately it is one of the easier A2007 bugs to work around.
 
Back
Top