Saving a ACCDE file gives an error message

New Contributor

I am designing a database to share with people who do not have access, and I can not get Access to save as an ACCDE file

8 Replies

@Jeanette2280 

 

Often, describing behavior, rather than outcomes, makes it possible to answer questions about processes like "creating an accde".

Details about the environment also help. 


What version of Access are you using, for example?

How did you attempt to save an accdb as an accde (steps you took)?

Did you compile the VBA first? 

What was the error message? 

 

The more we know about the situation, the more likely it is someone can offer useful suggestions.

 

One possibility, of course, is that your VBA does not compile. That's a very common reason for failure to create an accdb. That would be where I'd look first, but there could be something else, so let's start with the VBA. 

 

Thanks for the detail needed to help offer suggestions.

@George Hepworth 

I am using ACCESS that comes with Microsoft 365. I am current in all updates.

I am compiling and repair before I attempt to save.

 

In trying to save as an ACCDE , I go to file and choose save as ACCDE and choose where to save 

I get a message box which states that "Access was unable to create the file .accde, .mde or .ade file"

 

I have discovered, by trial and error that if I take out autoexec that opens a welcome page and aids in navigation it will save. But doing that makes the database useless to most users. 

 

In the VBE options, make sure you have Require Variable Declaration ticked. This should be your default option but unfortunately Access doesn't do this automatically. Once ticked the line Option Explicit will be added to each new code module...but not existing modules
So, next make sure you have Option Explicit as the second line in EVERY code module and if not add it.

Now compile your database again. You will probably find errors that weren't flagged before.
Fix all errors and you should then be able to create an ACCDE successfully
Okay you are speaking to a newbie here
Where do I find the VBA option?
I tried the options under file and could not locate

@Jeanette2280 

First open the Visual Basic Editor (VBE) e.g. from the Database Tools ribbon

In the VBE, click Tools ...Options and tick the item highlighted

 

isladogs_0-1638127261865.png

 

Then make sure each code module has Option Explicit as line 2 as shown above.

After that, click Debug...Compile.

You will almost certainly have at lease one undeclared variable.

Fix and continue until your project is compiled. Then try saving as ACCDE again.

@Jeanette2280 

 

You can find the VBE Here:

 

GeorgeHepworth_0-1638127670051.png

 

Compile here, and add Option Explicit to all Code modules.

GeorgeHepworth_1-1638127799837.png

 

 

Compile is greyed out
I cant access it ?
When its greyed out, that means it is fully compiled