Error partaining to references

tad0075

Registered User.
Local time
Today, 12:24
Joined
Jun 6, 2012
Messages
48
My code was working fine earlier today, however I've started receiving an error:

"The expression On Enter you entered as the event property setting produced the following error: a problem occurred while Microsoft Office Access was communicating with the ole server or ActiveX control."

I closed and reopened and tried a compact and repair. As far as I can tell, only one of my codes is throwing this error. So far I can't find any functions unique to this sub. Here's the code that's throwing the error:

Code:
Private Sub AppFee_Enter()
Dim Small As Boolean
Dim AppType As Integer
Dim Fee As Currency

If IsNull(Me.AppType.Value) Then

Exit Sub

Else

AppType = Me.AppType.Value
Small = Me.AppSmallOperator
Fee = DLookup("[Fee]", "[Fees List]", "[FeeTypeID] = 1 And [SmallLarge] = " & Small & " And [SpecialtyTypeID] = " & AppType)
Me.AppFee = Fee

End If

End Sub

I also checked my references, and found the following references active:

Visual Basic for Applications
Microsoft Access 12.0 Object Library
OLE Automation
Microsoft Office 12.0 Access database engine Object Library
Microsoft VBScript Regular Expressions 5.5
Microsoft Visual Basic for Applications Extensibility 5.3

None are missing. I have around 200 available references, so it's tough to figure out which ones to test. I tried 3 ActiveX references, but these did not fix the problem. I also have other available references named "Visual Basic for Applications," but I'm not able to swap these out through my VB window.

Any idea what I'm missing?

Thanks,
Tyler
 
A cause for the above error can at times have little to do with the error message provided, so location or reason are something else. As far as I recall it can be generated by inappropriate use of objects, or certain compiler errors.

In the code window, Debug->Compile

If that doesn't give anything , start removing code - comment out subs and functions and comment them back in, until you have narrowed down what gives the error. (You can comment in/out an entire block of code using the icon for that on the Edit toolbar. If you don't see teh Edit toolbar, then tick View ->Toolbars->Edit ). The error most likely has nothing to do with any Enter event, nor with any references.
 
Thanks for the tips. I compiled the code, no change. Also tried commenting out different parts of the code, and the only thing that gave me a different error was commenting out the "Private Sub" line. I even commented out everything within the Sub, and I still get the same error.

The error is triggered by the On Enter event, or at least at the same time as the On Enter event. I can reliably pull the error by exiting and entering the text box that has the trigger.

I also opened a copy of the db on another computer and pulled the same error.

I'm not sure where to look next.
 
Presumably the AppFee is a textbox on a form, where does the code halt, is it before the code in the above even tries to execute.
Sometimes deleting the textbox or control and creating a new one does the trick, copy the code from the deleted object
David
 
David -
I couldn't get any code to execute. Tried commenting out everything inside the sub, tried a msgbox command on the first line, and nothing changed.

I recreated the form to get rid of the error. I copied the code from the old form to the new one, and the error did not come back. It's not my favorite solution, but at least the error is gone.

Thanks for your input,

Tyler
 

Users who are viewing this thread

Back
Top Bottom