Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2004, 02:28 PM
Authorized User
 
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No rules...when strange things start to happen, it is best to make a copy of the database and then attempt a compact and repair. If that doesn't work, then start checking references, compiling and rebuilding. There are no hard fast rules.

Make sure that you don't manually create event procedure headings. Always let Access do it.

Regards,
Mike
 
Old February 19th, 2004, 02:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It really depends upon which reference / library is missing. The most common are ADO and DAO.
  • Open a block of code in the VBA editor. This can be a Module or Form or a Report - Forms and Reports require Design View / Code View.
  • From the Main Menu select: Tools / References.
At this point you should see a list of the references.

If your references are MISSING, you may need to use and / or install them.
 
  • Use
  • Scroll down the reference list until you find the reference.Check off each missing reference. If the reference you need is not on the list, you will need to install it. (See Below)
  • IMPORTANT: After all the new references are checked, click on the Ok button.
  • Open Tools / References again.
  • Verify that the NEW references are listed at the top.

 
  • Install
  • Close the VBA editor.
  • Close the Form or Report (If opened).
  • Close Access
  • Install the new library. You may need to download a new MDAC from Microsoft.
  • Restart Access





Rand
 
Old February 19th, 2004, 02:55 PM
Registered User
 
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for everything guys!!!

Paul
 
Old March 4th, 2005, 01:33 PM
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kwits
Default

Quote:
quote:Originally posted by rgerald
 Whenever a particular database form tries to execute any VBA code, I get the following error message:

Quote:
quote:The expression XXXXXXX you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control.
XXXXXXX is the name of the event (After_Update, Before_Update, Form_Load, Current, etc).

This occurs even if the code for the event is something as simple as Me.Refresh. If I reference a function or subroutine, the form behaves as if the function or subroutine doesn't exist. The same error occurs if I try to execute the procedure from the immediate window.

Can this be fixed or should I start over?

Rand
Keith Woodard
 
Old March 4th, 2005, 01:34 PM
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kwits
Default

Good Day,

 How did you resolve your problem with Access?

Regards,




Quote:
quote:Originally posted by rgerald
 Whenever a particular database form tries to execute any VBA code, I get the following error message:

Quote:
quote:The expression XXXXXXX you entered as the event property setting produced the following error: A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control.
XXXXXXX is the name of the event (After_Update, Before_Update, Form_Load, Current, etc).

This occurs even if the code for the event is something as simple as Me.Refresh. If I reference a function or subroutine, the form behaves as if the function or subroutine doesn't exist. The same error occurs if I try to execute the procedure from the immediate window.

Can this be fixed or should I start over?

Rand
Keith Woodard
 
Old April 14th, 2008, 07:40 PM
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I'm having same error for missing references. I installed the object libraries and checked in Access that it shows the libraries in the references but the error still persists. Do we have to install Access again? or recreate the forms? Am I missing something? Please Advise.

Thanks for help!
Regards,






Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code D0MiN0 Access VBA 2 March 31st, 2008 03:55 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
vba code in.ssuresh Excel VBA 1 November 28th, 2005 05:10 AM
Help with VBA Code KevinN Excel VBA 1 April 22nd, 2005 06:50 AM
Download of code - Failure Mark200408 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 5 September 11th, 2004 08:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.