PDA

View Full Version : SOLVED: Access Error



Rollin_Again
07-29-2004, 11:30 AM
Can someone please tell me what would be causing the following errors to
occur when trying to open my Access Form

"The Expression On Load you entered as the event property setting produced
the following error: Member already exists in an object module from which
this object module derives"


What have I done to cause this error to occur?


Rollin

SJ McAbney
07-29-2004, 11:34 AM
What code do you have in the OnLoad event?

Rollin_Again
07-29-2004, 11:38 AM
What code do you have in the OnLoad event?


Private Sub Form_Load()

cmbVendors = cmbVendors.ItemData(0)
Call cmbVendors_AfterUpdate
Call EditMode(False)

End Sub

Rollin

GP George
07-29-2004, 03:08 PM
If you have created a function called EditMode, Access is confused because EditMode is a property of dao and ado recordsets and can't be set this way.

Rename your function to something else, like SetEditMode, and try again.

HTH

George

Rollin_Again
07-29-2004, 04:18 PM
If you have created a function called EditMode, Access is confused because EditMode is a property of dao and ado recordsets and can't be set this way.

Rename your function to something else, like SetEditMode, and try again.

HTH

George
Thanks George,

I've only got about 10 hairs left in my head from pulling them out trying to solve this problem. Indeed the problem was due to the name I gave one of my sub-procedures.

Rollin

SJ McAbney
07-29-2004, 04:37 PM
I'll close this now that it's solved but, before I do:


cmbVendors = cmbVendors.ItemData(0)
Change this to:

Me.cmbVendors = Me.cmbVendors.ItemData(0)

The compiler likes that ;)