Member Already Exists in an object module from which this object..

R

Robert_L_Ross

Ok, so this is baffling me.

I have a form that the OnCurrent event is set to check the status of certain
fields to see if their associated command buttons should be activated or not,
then sets the caption of the form to reflect the record name you are editing.

I kept getting an error "The expression On Current you entered as the event
property setting produced the following error: Member already exists in an
object module from which this object module derives."

I have NO idea what that means. I remove the On Current event and it works,
I put in any On Current functionality and I get the error.

What should I be looking for to see why this is happening?
 
B

boblarson

It sounds as if you are actually TYPING this part:

Private Sub Form_Current()

instead of letting Access do it. You can't type an event in, you must
select it either from the property dialog and click the elipsis to get to it,
or use the combo box to select the event from the VBA window.
 
R

Robert_L_Ross

Bob,

No, I thought of that. I double checked (copied all code from the page into
notepad and did a search). I tried deleting what was there, the page opened
fine. I then went back into design mode, properties, entered a bracket "["
in the On Current value, then hit the elipses "..." and let Access enter the
"Private Sub On_Current_Click()".

I have no idea why it's happening. I renamed the form, copied everything
into the new form, then went through each control and entered the code and
the new form seems to be working OK so far...but this is a really weird error
and I want to find out why it happened so I can prevent it in the future...I
don't want it coming back to haunt me on the next form I design in the db!

Thanks though for the answer!
 
B

boblarson

Sometimes corruption will start to creep in as well. You might try creating
a new, blank mdb file and import everything in to the new one from the old
and see how that goes. It really sometimes has no rhyme or reason that is
discernable as to why this happens.

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.


Robert_L_Ross said:
Bob,

No, I thought of that. I double checked (copied all code from the page into
notepad and did a search). I tried deleting what was there, the page opened
fine. I then went back into design mode, properties, entered a bracket "["
in the On Current value, then hit the elipses "..." and let Access enter the
"Private Sub On_Current_Click()".

I have no idea why it's happening. I renamed the form, copied everything
into the new form, then went through each control and entered the code and
the new form seems to be working OK so far...but this is a really weird error
and I want to find out why it happened so I can prevent it in the future...I
don't want it coming back to haunt me on the next form I design in the db!

Thanks though for the answer!

boblarson said:
It sounds as if you are actually TYPING this part:

Private Sub Form_Current()

instead of letting Access do it. You can't type an event in, you must
select it either from the property dialog and click the elipsis to get to it,
or use the combo box to select the event from the VBA window.

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.
 
A

Ann in CA

Just an FYI, I just encountered this error and found why it was happening, at
least for me: I was trying to declare a variable in my form, but I was
inadvertently using the name of the variable as the name of a textbox in my
form. Oops =)



Robert_L_Ross said:
Bob,

No, I thought of that. I double checked (copied all code from the page into
notepad and did a search). I tried deleting what was there, the page opened
fine. I then went back into design mode, properties, entered a bracket "["
in the On Current value, then hit the elipses "..." and let Access enter the
"Private Sub On_Current_Click()".

I have no idea why it's happening. I renamed the form, copied everything
into the new form, then went through each control and entered the code and
the new form seems to be working OK so far...but this is a really weird error
and I want to find out why it happened so I can prevent it in the future...I
don't want it coming back to haunt me on the next form I design in the db!

Thanks though for the answer!

boblarson said:
It sounds as if you are actually TYPING this part:

Private Sub Form_Current()

instead of letting Access do it. You can't type an event in, you must
select it either from the property dialog and click the elipsis to get to it,
or use the combo box to select the event from the VBA window.

--
Bob Larson
Access World Forums Super Moderator
____________________________________
If my post was helpful to you, please rate the post.
 

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