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

Access ACCDE or MDE files stop buttons working

P: 3
Hello, I found a previous posting by someone on the 10th Sept (http://www.thescripts.com/forum/thread705528.html) who seemed to have the same problem as me, but it was never resolved.

I have created a database with many navigation pages which lead to other forms using buttons. Also some forms are populated by combo boxes where you can select the record from a drop down box and it fills that record's details on the form. This all works brilliantly in the normal mode.

However when I made an MDE (as I use Access 2007, but am giving the database to a friend with 2003 so I have been using Access 2007 in 2003 compatibility mode) all the buttons stop working and the combo box no longer populates the forms. I tried making an ACCDE (upgrading to 2007 mode and then converting just to see if it was the MDE making it go wrong) but that also resulted in all the buttons stopping working.

Here is the code for one of the buttons for example:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Go_to_Adult_Maintenance_Form_Click()
  2.  
  3. On Error GoTo Err_Go_to_adult_maintenance_form_Click
  4.  
  5.     Dim stDocName As String
  6.  
  7.     stDocName = "Child Query"
  8.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  9.  
  10.     stDocName = "Adult Query Update"
  11.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  12.  
  13.     stDocName = "Household Carer Query"
  14.     DoCmd.OpenQuery stDocName, acNormal, acEdit
  15.  
  16.     Dim stLinkCriteria As String
  17.  
  18.     stDocName = "Adult Navigation Page"
  19.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  20.  
  21. Exit_Go_to_adult_maintenance_form_Click:
  22.     Exit Sub
  23.  
  24. Err_Go_to_adult_maintenance_form_Click:
  25.     MsgBox Err.Description
  26.     Resume Exit_Go_to_adult_maintenance_form_Click
  27.  
  28. End Sub
  29.  
Please help!

Many many thanks,

Lindsay
Oct 19 '07 #1

✓ answered by nico5038

In general moving a database to another PC can cause Library links to get "lost".
When you have Access installed, open some VBA code (e.g. by pressing [CTRL+G]) and select Tools/References.
Each libraryname starting with "MISSING" must be unchecked and (e.g. microsoft DAO version x.xx) replaced when necessary.

As access doesn't cleanup added libraries, often unnecessary refenreces are present.
Just delete as many as possible without getting an error executing "Debug/compile all modules"

For Access 2007 an additional problem arises with the so-called "trusted locations". You'll need to make a folder (and/or it's subfolders) trusted to allow code to be executed. See the Security section when activating the [Access Options] button on the Officebutton menu.

Nic;o)

Share this Question
Share on Google+
10 Replies


nico5038
Expert 2.5K+
P: 3,072
In general moving a database to another PC can cause Library links to get "lost".
When you have Access installed, open some VBA code (e.g. by pressing [CTRL+G]) and select Tools/References.
Each libraryname starting with "MISSING" must be unchecked and (e.g. microsoft DAO version x.xx) replaced when necessary.

As access doesn't cleanup added libraries, often unnecessary refenreces are present.
Just delete as many as possible without getting an error executing "Debug/compile all modules"

For Access 2007 an additional problem arises with the so-called "trusted locations". You'll need to make a folder (and/or it's subfolders) trusted to allow code to be executed. See the Security section when activating the [Access Options] button on the Officebutton menu.

Nic;o)
Oct 19 '07 #2

P: 3
Dear Nic;o),

Thanks for your help, but this problem happens on my own PC, so I have not moved PCs. I just convert my fully working .mdb or .accdb into an .mde or an .accde and all the buttons stop working. I have not emailed them the final version as it does not work on my own computer.

I looked in the libraries section you described and there were no missing ones, and I made the location where I store my file "trusted" and that made no difference aswell.

It seems to be a problem created by the "locking" of the database by making it an .mde or an .accde

Do you have any other ideas, as the database is unusable as currently stands, unless I give it to my friend as design editable (and I really don't trust them with that, no offence meant about their PC skills!)

Lindsay
Oct 20 '07 #3

ADezii
Expert 5K+
P: 8,638
Dear Nic;o),

Thanks for your help, but this problem happens on my own PC, so I have not moved PCs. I just convert my fully working .mdb or .accdb into an .mde or an .accde and all the buttons stop working. I have not emailed them the final version as it does not work on my own computer.

I looked in the libraries section you described and there were no missing ones, and I made the location where I store my file "trusted" and that made no difference aswell.

It seems to be a problem created by the "locking" of the database by making it an .mde or an .accde

Do you have any other ideas, as the database is unusable as currently stands, unless I give it to my friend as design editable (and I really don't trust them with that, no offence meant about their PC skills!)

Lindsay
This is reeeeeeeeally a long shot, but try declaring a seperate Variable for each instance of use:
Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String, stDocName2 As String, stDocName3 As String
  2. Dim stDocName4 As String
  3.  
  4. stDocName = "Child Query"
  5. DoCmd.OpenQuery stDocName, acNormal, acEdit
  6.  
  7. stDocName2 = "Adult Query Update"
  8. DoCmd.OpenQuery stDocName2, acNormal, acEdit
  9.  
  10. stDocName3 = "Household Carer Query"
  11. DoCmd.OpenQuery stDocName3, acNormal, acEdit
  12.  
  13. Dim stLinkCriteria As String
  14.  
  15. stDocName4 = "Adult Navigation Page"
  16. DoCmd.OpenForm stDocName4, , , stLinkCriteria
Oct 20 '07 #4

nico5038
Expert 2.5K+
P: 3,072
Hmm. tested the creation of an .accde on my machine (Using a Dutch version), but had no trouble with the buttons.

What code is executed when starting the first form of the database ?

Nic;o)
Oct 20 '07 #5

P: 3
FIXED!!!!! When I did the Control G on the .mde file there was no code there at all. So, I saw that there was a compile option on the original .mdb file which I had never done. So when I compiled the code and then made an .mde it worked! Thanks so much I would never have thought about that until you wanted the code executed on the first page. THANK YOU!
Oct 21 '07 #6

nico5038
Expert 2.5K+
P: 3,072
In an .mde there will never be code visible as Access will pre-compile the code and use that instead.
Compiling code is always advisable, I do it all the time as it will warn you when you're making mistakes. Moreover, compiling before creating an .mde or converting to another Access version is mandatory.

Glad it's solved,

Success with the application !

Nic;o)
Oct 21 '07 #7

P: 1
Worked perfectly. Saved a major rewrite. :)

Lindsay Browning has the perfect, easy to us solution.
Try it out. Give her a hug!!!!
Apr 13 '17 #8

NeoPa
Expert Mod 15k+
P: 31,494
Hi. Thanks for posting. It reminds us all that even threads of ten years old can still be relevant and helpful today.

I'd been contributing less than a year when this thread was started.
Apr 14 '17 #9

PhilOfWalton
Expert 100+
P: 1,430
It's only a small point, but I always have

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
at the top of every module. That way the compiler reports on undeclared variable and duplicated variables with a procedure.

Phil
Apr 14 '17 #10

NeoPa
Expert Mod 15k+
P: 31,494
Indeed Phil.

I have a small article on the subject I use to point people to when it comes up (Require Variable Declaration).

This particular thread predates anything I had on that though ;-)
Apr 14 '17 #11

Post your reply

Sign in to post your reply or Sign up for a free account.