Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expression On Current error (Compile Error: Method...not found)

Status
Not open for further replies.

sniffingvixen

Technical User
Dec 6, 2006
13
US

I'm working in Access 2003. I have a form containing code that was entirely functional earlier today, but now gives me the following error when opened:
The expression On Current 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.

*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.
This form performs the following actions in response to the following events.
Actions:
* changes the Enabled property of various controls, including text, combo, and check boxes.
* clears values from various fields
* changes the ForeColor of several unbound labels
Events:
* form's On Current
* some fields' On Change
* some fields' After Update

Between the time when it worked and when it stopped working, I have done the following:
* Modified the source table, including some pertinent fields.
* Copied and saved the form under a different name, but deleted all code from the copy.
* Closed and reopened Access.
* DID NOT alter any of the controls' properties on the form.

When I run the Debug; Compile DatabaseName feature in Visual Basic Editor, I receive the following error:
Compile error: Method or data member not found
This error refers to the underlined part of the following expression (or any similar expression referring to another control):
Code:
Me.Breakfast[u].Enabled =[/u] False
I checked my references as recommended by glalsop in thread702-853541, but the DAO 3.6 library was still active.

Anyone know what's happened here?

Many thanks in advance, j
 
More information on this confusion...

I wrote almost identical code for another form in the database and it's working perfectly. It remains functional after having closed out of Access and reopened the database several times.

Also, when I try to rewrite the problematic code within the associated form. VBA prompts me to complete the expression as follows:
Code:
Me.Breakfast.Value
This is the only property allowed.

Please help if you can because I'm starting to think my database or its objects have become somehow corrupted!

Thanks, j
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top