Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: On click error appearing

    i have a form, that i have added a button, when i click the button i get the following message.


    The expression on click you entered as the event property setting produced the following error: Ambiguous name detected: LME_Click.

    *The expression may result in the name of a macro, the name of a user defined function, or [event procedure].
    *There may have been an error evaluating the function, event, or macro



    can someone please explain this in very basic terms, and the best way around fixing it please.

    the code behind the button is.....



    Private Sub LME_Click()
    On Error GoTo Err_LME_Click

    'Calls the calender form and set calstartref
    Dim stDocName As String
    Dim stLinkCriteria As String

    CalStartRef = "LME"

    stDocName = "frmCalender"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_LME_Click:
    Exit Sub

    Err_LME_Click:
    MsgBox Err.Description
    Resume Exit_OpenCalOEE_Click

    End Sub



    my buttons name is : LME
    My form name is: LME


    please help

    Andy

  2. #2
    Join Date
    Dec 2003
    Posts
    36
    Use a different name for your btn and form.

    By example: Frm_LME and Btn_LME

    greetz
    ... man man man ...

  3. #3
    Join Date
    Mar 2003
    Posts
    225
    right this is every bit of code on that form...

    i have changed the button name to button_LME

    and the form name to frmLME


    Option Compare Database
    Option Explicit

    Private Sub Options()
    Select Case OptionGroupName
    Case 1
    DoCmd.OpenReport "LME_H0", acViewPreview
    Case 2
    DoCmd.OpenReport "LME_H1", acViewPreview
    Case 3
    DoCmd.OpenReport "LME_H2", acViewPreview
    Case 4
    DoCmd.OpenReport "LME_H3", acViewPreview
    Case 5
    DoCmd.OpenReport "LME_H4", acViewPreview
    Case 6
    DoCmd.OpenReport "LME_H5", acViewPreview
    Case 7
    DoCmd.OpenReport "LME_H6", acViewPreview
    Case 8
    DoCmd.OpenReport "LME_H7", acViewPreview
    Case 9
    DoCmd.OpenReport "LME_H8", acViewPreview
    Case 10
    DoCmd.OpenReport "LME_H9", acViewPreview
    Case 11
    DoCmd.OpenReport "LME_CO", acViewPreview
    Case 12
    DoCmd.OpenReport "LME_C1", acViewPreview
    Case 13
    DoCmd.OpenReport "LME_C2", acViewPreview
    Case 14
    DoCmd.OpenReport "LME_C3", acViewPreview
    Case 15
    DoCmd.OpenReport "LME_C4", acViewPreview
    Case 16
    DoCmd.OpenReport "LME_C5", acViewPreview
    Case 17
    DoCmd.OpenReport "LME_T3", acViewPreview
    Case 18
    DoCmd.OpenReport "LME_V2", acViewPreview
    Case 19
    DoCmd.OpenReport "LME_D2", acViewPreview
    Case 20
    DoCmd.OpenReport "LME_B2", acViewPreview
    Case 21
    DoCmd.OpenReport "LME_F", acViewPreview
    Case 22
    DoCmd.OpenReport "LME_S1", acViewPreview
    Case Else
    MsgBox "please select a line"
    End Select

    End Sub

    Private Sub button_LME_Click()
    On Error GoTo Err_button_LME_Click

    'Calls the calender form and set calstartref
    Dim stDocName As String
    Dim stLinkCriteria As String

    CalStartRef = "frmLME"

    stDocName = "frmCalender"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_button_LME_Click:
    Exit Sub

    Err_button_LME_Click:
    MsgBox Err.Description
    Resume Exit_button_LME_Click
    End Sub


    buit now i get a different message:-

    The expression on click you entered as the event property setting produced the following error: Member already exists in a object module from which this object module derives

    *The expression may result in the name of a macro, the name of a user defined function, or [event procedure].
    *There may have been an error evaluating the function, event, or macro


    this is doing my head in now.....Help!!!!

  4. #4
    Join Date
    Dec 2003
    Posts
    36
    you probably have the old name used somewhere else.
    check your macros/queries,...
    ... man man man ...

  5. #5
    Join Date
    Mar 2003
    Posts
    225
    i have attached a sample database that only includes 2 forms but it produces the same error
    Attached Files Attached Files

  6. #6
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250
    check the form properties make allow edit = yes. You may need to let allow additions = yes, also.

Posting Permissions

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