PC Review


Reply
Thread Tools Rate Thread

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

 
 
Samantha Rawson via AccessMonster.com
Guest
Posts: n/a
 
      24th Jan 2005
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?!?!

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
 
 
 
Sandra Daigle
Guest
Posts: n/a
 
      24th Jan 2005
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...b;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.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Samantha Rawson via AccessMonster.com wrote:
> 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?!?!



 
Reply With Quote
 
 
 
 
Samantha Rawson via AccessMonster.com
Guest
Posts: n/a
 
      25th Jan 2005
Thanks a lot, I'll go through my code and check.

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
Samantha Rawson via AccessMonster.com
Guest
Posts: n/a
 
      25th Jan 2005
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

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
Sandra Daigle
Guest
Posts: n/a
 
      25th Jan 2005
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

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Samantha Rawson via AccessMonster.com wrote:
> 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



 
Reply With Quote
 
Samantha Rawson via AccessMonster.com
Guest
Posts: n/a
 
      26th Jan 2005
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

--
Message posted via http://www.accessmonster.com
 
Reply With Quote
 
Sandra Daigle
Guest
Posts: n/a
 
      26th Jan 2005
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.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Samantha Rawson via AccessMonster.com wrote:
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
member already exists in an object module... Sean Timmons Microsoft Access 6 13th Mar 2010 06:54 PM
Object cannot be created at this URL because an object named by thisURL already exists Dhananjay Microsoft Dot NET 0 11th Jan 2008 02:42 PM
Member Already Exists in an object module from which this object.. =?Utf-8?B?Um9iZXJ0X0xfUm9zcw==?= Microsoft Access Form Coding 4 4th Jan 2008 12:43 AM
Member already exists in an object module from which object derive =?Utf-8?B?THVjaw==?= Microsoft Access Form Coding 2 8th Dec 2004 01:09 AM
Strange problem with -Site SMTP Transport, which I did not install. "Object already exists" Max Avramenko Microsoft Windows 2000 Active Directory 0 23rd Mar 2004 02:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:20 AM.