yifan
09-19-2006, 02:23 AM
"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
boblarson
09-19-2006, 10:08 AM
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:
Private Sub MyControlName_Click()
End Sub
Something else may be here...
Private Sub MyControlName_Click()
groengoen
11-01-2006, 11:11 AM
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
11-01-2006, 11:12 AM
PS. this is in Access 2000.
gemma-the-husky
11-01-2006, 11:15 AM
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?
groengoen
11-01-2006, 11:17 AM
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?