ACC2000: Error Message: Member Already Exists in an Object Module from Which This Object Module Derives (279124)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q279124
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

When you run code in an Access form or report, you may receive the following error message:
The expression <expression> you entered as the event property setting produced the following error: Member already exists in an object module from which this object module derives.

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.

CAUSE

A Sub procedure and an object in your form or report have the same name. For example, you may have a form with a text box named CategoryID and also have a Sub procedure in the Visual Basic for Applications module of that form named CategoryID().

RESOLUTION

Search through the code module of the form or the report to see if any Sub procedure has the same name as an object on the form or report. If so, rename the Sub procedure or rename the object.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. Open the Categories form in Design view.
  3. Add a text box named CurrentDate to the form.
  4. On the View menu, click Code.
  5. Type or paste the following code into the module:
    Private Sub Form_Current()
      Me.CurrentDate = CategoryID
    End Sub
    
    Function CategoryID()
      CategoryID = DateValue(Now())
    End Function
    						
    Close the module and view the form in Form view.

    Note that you receive the error message that is mentioned in the "Symptoms" section of this article.

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kberrmsg kbnofix kbprb KB279124