Error: 'Member already exists in an object module from which this object...'

  • Thread starter Samantha Rawson via AccessMonster.com
  • Start date
S

Samantha Rawson via AccessMonster.com

My code is as follows:

Private Sub NoOrdered_AfterUpdate()

DoCmd.OpenForm "frm_tu_rem", acNormal
DoCmd.GoToRecord , , acFirst

Form_frm_tu_rem.Turkeys_Remaining.Value = Form_frm_tu_rem.Turkeys_Remaining.Value - NoOrdered.Value


DoCmd.Close acForm, "frm_tu_rem"
End Sub

frm_tu_rem stores the total number of items remaining, in one record. After the NoOrdered is updated, it opens this form and takes away the value that the user has inputted in NoOrdered. It then closes the form. I cannot see where I go wrong, yet I get this message:

'Member already exists in an object module from which this object module derives'

Can anyone help please?!?!
 
S

Sandra Daigle

Hi Samantha,

Take a look at the following KB article:

ACC2000: Error Message: Member Already Exists in an Object Module from Which
This Object Module Derives
http://support.microsoft.com/default.aspx?scid=kb;en-us;279124

If this doesn't work make sure that in the property sheet for the
AfterUpdate event the text "[Event Procedure]" is in the property. You may
even want to copy the body of the procedure to your clipboard, delete the
procedure itself and readd it by letting Access rebuild the procedure header
and footer. Then copy the body of the procedure back in.

Also make sure that you don't have this procedure duplicated in the class
module.
 
S

Samantha Rawson via AccessMonster.com

OK, tried what the website said (check if sub had same name) but to no avail. My textbox is 'NoOrdered' and my sub function is 'NoOrdered_AfterUpdate'. I deleted my code, made the program write the header and footer then rewrote my code, but still came up with error message. Checked it had [Event Procedure] in the properties on AfterUpdate. Don't know what to do, hope I don't have to restart the database; it's taken me about half a year! Any more help anyone can offer would be much appreciated.

Samantha Rawson
 
S

Sandra Daigle

Have you tried renaming your control? (If you do you'll have to copy the
guts of the event procedure to one on the new control and make sure that
"[Event Procedure]" is in the property.

Also, try revising your statement from:

Form_frm_tu_rem.Turkeys_Remaining.Value =
Form_frm_tu_rem.Turkeys_Remaining.Value - NoOrdered.Value

To

Forms!frm_tu_rem.Turkeys_Remaining=Forms!frm_tu_rem.Turkeys_Remaining-me.NoOrdered.Value

Also, make sure you don't have a *function* named NoOrdered
 
S

Samantha Rawson via AccessMonster.com

Changed my code, thanks, looks better now. Found my problem, below this code I had an OnCurrent function that I'd written myself, but wasn't an [Event Procedure]. D'oh!

Works great now, many thanks guys.

Samantha Rawson
 
S

Sandra Daigle

Glad you found it - that error message is a little vague since it could
apply to several types of duplicated procedure names. It's hard to tell
which one you should be looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top