Can not make ACCDE

hfsitumo2001

Member
Local time
Today, 02:42
Joined
Jan 17, 2021
Messages
394
Anyone knows why I can not make my ACCDB to ACCDE?, this is the error message:
"Microsoft Access was unable to create the .accde, .mde, or .ade file."
I have not split yet to backend, because I want it for training first.
 
The most common reason is that you have a compilation error in some part of your code.

Can you go into the VBA code and successfully perform a "Compile" (from the DEBUG menu, I think...)
 
Add:
Option Explicit to each Module, Form/Report module.
then compile your Compile your db.
you need to resolve those errors before
you can successfully save your db to .accde/mde.
 
Add:
Option Explicit to each Module, Form/Report module.
then compile your Compile your db.
you need to resolve those errors before
you can successfully save your db to .accde/mde.
Arnel, If I put Option Explicit in every module, will the event procedure of each object still work?

Thank You
 
Option explicit will only force VBA to alert you when a variable is not declared when you hit debug compile. After adding option explicit you must compile the code. The concern is that the uncompiled code will not let you make the ACCDE, and it may not compile with undeclared variables.
 
I thought @arnelgp would reply. If you do not pre-define variables, you can still use them, but vba will create them as variant types. If you spelled variables differently in different places., your programme may not work correctly, and you may find it hard to work out why.

So after you add option explicit and then compile the application you my find that you need to declare variables that you have used without declaring them.

(note you can set this a standard in your app - in a module do tools/options/require variable declaration set to true)

You also need to be aware of the scope of a variable. A variable can be declared to have scope within the whole application, just one form, or even just one procedure, which again has an impact on your coding.

Your programme not compiling may also be to do with syntax errors in code, that you may not even use. It's not necessarily down to variable declaration.
 
Option explicit will only force VBA to alert you when a variable is not declared when you hit debug compile. After adding option explicit you must compile the code. The concern is that the uncompiled code will not let you make the ACCDE, and it may not compile with undeclared variables.
How can I compile it MajP
 
The most common reason is that you have a compilation error in some part of your code.

Can you go into the VBA code and successfully perform a "Compile" (from the DEBUG menu, I think...)
ok I will Try it Doc_Man
 
When you do the compile, it will stop at the first error it finds, including your undeclared variables, so it may take some time to work through the whole database.
 
When you do the compile, it will stop at the first error it finds, including your undeclared variables, so it may take some time to work through the whole database.
Thank you Gemma, I can make now ACCDE, you guys are all awesome!
 
I thought @arnelgp would reply. If you do not pre-define variables, you can still use them, but vba will create them as variant types. If you spelled variables differently in different places., your programme may not work correctly, and you may find it hard to work out why.

So after you add option explicit and then compile the application you my find that you need to declare variables that you have used without declaring them.

(note you can set this a standard in your app - in a module do tools/options/require variable declaration set to true)

You also need to be aware of the scope of a variable. A variable can be declared to have scope within the whole application, just one form, or even just one procedure, which again has an impact on your coding.

Your programme not compiling may also be to do with syntax errors in code, that you may not even use. It's not necessarily down to variable declaration.
Gemma, after we make ACCDE, people still can modify the Switchboard thru Switchboard Manager in MS Access 2016. How can we prevent this.
 
@hfsitumo2001
To add to what everyone else has said, you have now identified a new practice that you should always do and never deviate from: Any and all modules should always have Option Explicit at the top of them (as gemma said, adjust your Tools Options to make it automatic) from now on.

Just to be clear
 
Add:
Option Explicit to each Module, Form/Report module
you need to resolve those errors.

I have also same problem.
And before some of form and Module not have "Option Explicit". Now I add all of FORM.

My any FORM dont have any error. I check one by one form to open.
but still I can't create .accde file.
What can I do now ?
 
Can you compile your database in the VBA editor?

Debug ¬ Compile

Not having an error when you open a form is not enough. The Code HAS to compile.
 
The fact that a form opens doesn't mean there's no error

There could be an error in code you haven't used yet.

Option Explicit means that you need to pre-define all variables. Compiling ensures that syntax is correct, and variables are declared throughout the database. If you can't produce an accde file, there will 100% be errors reported while compiling
 
Also if you have any empty procedures with no code between the title line and the End Sub/Function line, you cannot create an ACCDE as Access doesn't know how to interpret such procedures. Recent versions of Access normally delete these automatically when you compile your code but it is possible this won't have happened if your app crashed at any point.
 
Also if you have any empty procedures with no code between the title line and the End Sub/Function line, you cannot create an ACCDE as Access doesn't know how to interpret such procedures. Recent versions of Access normally delete these automatically when you compile your code but it is possible this won't have happened if your app crashed at any point.
Thank you so much for your information.
Yes. That type of I have blank. Now I try to delete all
If I have Like below code. that should delete also ?
Code:
Private cmdDelete_Click
'something
'something
Sub End
Any code block, then should be delete
Answer please...
 
If there are any comments between the header and End line, Access won't delete them automatically.
If the procedures contains nothing but comments either delete it completely or also comment out the First and last lines.

BTW the first line should be Private Sub cmdDelete_Click. As written, your code won't compile so an ACCDE won't ever be created.

Have you added Option Explicit as the second line in each code module and then compiled your project correcting all errors?
 

Users who are viewing this thread

Back
Top Bottom