 |
| 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
|
|
|
|

August 27th, 2003, 11:10 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
VBA code failure
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
__________________
Rand
|
|

August 28th, 2003, 07:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Rand,
Have you made sure that all the appropriate reference libraries are active?
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
|

February 19th, 2004, 01:13 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello to all!
I have the same problem. rgerald, did you find a solution?
Thanks
Paul
|
|

February 19th, 2004, 01:28 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi there,
What controls are on the form?
Does the code manually compile?
Mike
|
|

February 19th, 2004, 01:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This was a while back, but I think it turned out to be related to references. If the references list is not complete for ALL CODE, similar messages may appear.
Sometimes the message may refer to an unrelated reference that actually does exist, even though the actual missing reference is in a different library.
Rand
|
|

February 19th, 2004, 01:45 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Mike,
Thanks for answering.
The form has one button and one subform.
The only thing I am trying to do is to requery the subforms data.
So, on button_click I have imported the following:
Command1_Click()
Subformname.Requery
End sub
Eventhough I can compile the source code manually, on Form view button_click returns with the following message:
The expression on click you entered as the event property setting produced the following error: A problem occurred while MyTable was communicating with the OLE server or ActiveX Control.
*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.
Thanks,
Paul
|
|

February 19th, 2004, 02:05 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What happens if you replace the refresh code with msgbox "Refresh"?
Did you check your references to make sure that none are missing?
You might try rebuilding the form from scratch and see if the problem presents itself. The form may be corrupt.
HTH,
Mike
|
|

February 19th, 2004, 02:07 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Rand,
Sorry for disturbing you again but how can I be sure that the reference's list is complete for all code?
Thanks,
Paul
|
|

February 19th, 2004, 02:18 PM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
In the VB Editor window goto Tools | References. If there is a missing reference it will have the word MISSING in front of the reference.
Mike
|
|

February 19th, 2004, 02:23 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Mike, you are right! I created the form from the beginning and I don't have the same problem now.
But what do you mean with corrupted?
When does a form get corrupted? Is there a rule for this?
Thanks,
Paul
|
|
 |