please help, "member already existis..." error

yifan

Registered User.
Local time
Today, 06:52
Joined
Sep 15, 2006
Messages
13
"member already exists in an object module from which this module derives" error occurs at execution of every single function in a form underlying moduel written in VBA.

Can anyone tell me what could possibly cause this error?

The module is not derived from anyother module...

thanks very much
 
Sounds like you have designated an event within a module twice. So, for example if you have a command button and it has it's click event automatically entered by Access, and then you try to manually type in an event code like this:
Code:
Private Sub MyControlName_Click()

End Sub

Something else may be here...

Private Sub MyControlName_Click()
 
I get the same error as you in a form which I am trying to close with an "Exit" command button. There is no other instance of this click event anywhere in the project. I wonder if anyone knows the answer to these problems, which cannot be that proposed by Bob above. Here is my code:

Private Sub cmdExit2_Click()
On Error GoTo Err_cmdExit2_Click


DoCmd.Close


Exit_cmdExit2_Click:
Exit Sub

Err_cmdExit2_Click:
MsgBox Err.Description
Resume Exit_cmdExit2_Click

End Sub
 
groengoen

if your exit button is trapping an error, it may be a problem caused by something else. The docmd.close, will try to force the record to save before closing the form. If it can't save because of some other error say a mandatory field or something else, you may get an error message not related to the close event.

Is this possible?
 
I guess it is may be possible, but why don't I get an error when I close the form with the X at the top right hand corner?
 

Users who are viewing this thread

Back
Top Bottom