Consulting

Results 1 to 6 of 6

Thread: SOLVED: Access Error

  1. #1

    SOLVED: Access Error

    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

  2. #2
    VBAX Tutor SJ McAbney's Avatar
    Joined
    May 2004
    Location
    Glasgow
    Posts
    243
    Location
    What code do you have in the OnLoad event?

  3. #3
    Quote Originally Posted by Abulafia
    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

  4. #4
    VBAX Regular GP George's Avatar
    Joined
    Jul 2004
    Location
    Puget Sound, WA
    Posts
    26
    Location
    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
    "We're all in this together."
    -Red Green

  5. #5
    Quote Originally Posted by GP George
    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

  6. #6
    VBAX Tutor SJ McAbney's Avatar
    Joined
    May 2004
    Location
    Glasgow
    Posts
    243
    Location
    I'll close this now that it's solved but, before I do:

    Quote Originally Posted by Rollin_Again
    [vba]cmbVendors = cmbVendors.ItemData(0)[/vba]
    Change this to:

    [vba]Me.cmbVendors = Me.cmbVendors.ItemData(0)[/vba]

    The compiler likes that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •