We help IT Professionals succeed at work.

VBA Code works in MDB but not MDE

andy_booth
andy_booth asked
on
Medium Priority
809 Views
Last Modified: 2013-06-24
For some strange reason, part of my application doesn't work as an mde, but it works fine on the same machines as an mdb.

When the button is pushed the error shown says as follows.

"The expression On Click you entered as the event property setting produced the following error."
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].

*There may have been an error evaluating the function, event or macro

I will admit there is quite a bit of code under the button, but as it works fine within the MDB, the DB compiles etc, so why would this not work when made into an MDE?

Hope someone can give a quick answer on this one, I dont want to have to give people the MDB file.

Thanks
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
post the erring codes
CERTIFIED EXPERT
Top Expert 2016

Commented:
<the DB compiles etc, so why would this not work when made into an MDE?>
it all depends in what the codes is supposed to do.
remember that in an .mde file, for one, you can not change the design/property of form, report.

Author

Commented:
Hmm, its quite a lot of code, however, I have just noticed that this part of the system uses ado rather than dao. Could that make a difference?
CERTIFIED EXPERT
Top Expert 2016

Commented:
if the codes are running in .mdb it should also run in the .mde version, as long as it does not change any property of objects that the design option is not available in an .mde file

Author

Commented:
Yes, I am aware of this.

As a test I am going to re-write the ADO connection into a DAO one to see if it makes any difference.
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I have set my own solution as the answer, just in case anyone else is search for this problem.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.