Results 1 to 13 of 13
  1. #1
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19

    Command Buttons Stopped Working on Form

    Hi,



    I moved some Command Buttons on an input form and they stopped working. I needed to move the buttons to make room for a new report and after I created the new Command Button with the wizard I got:

    The expression On Click you entered as the event property setting produced the following error: Ambiguous name detected: HOME_Units_Click.

    This happened on all of the buttons. No matter which button I push I get the same error message.

    Any suggestions on what I did to make a mess of my form?

    Thanks!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does your button stinn have something in the Click event? What is it?

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Ambiguous name detected: HOME_Units_Click
    Usually that error means there are two or more controls with the same name. Could that be possible??

  4. #4
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    RuralGuy,

    Yes, [Event Procedure]

  5. #5
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    ssanfu,

    Nope, all buttons have different names.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Is there any code anywhere that has the same name.

    For instance, if you copied the button from Form1 to Form2 (button name stayed the same), created new code for the button on Form2, but didn't delete/change the name of the button on Form1.

    Also, in the IDE, have you tried the Compile command?

    In the IDE, do a find for "HOME_Units_Click". How many do you find?
    Last edited by ssanfu; 02-05-2013 at 01:39 PM. Reason: added thought.

  7. #7
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    ssanfu,

    Okay, now I will show my ignorance "IDE"?

  8. #8
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    Here's an example of what I see under VB:

    Private Sub Command148_Click()
    On Error GoTo Err_Command148_Click
    Dim stDocName As String
    stDocName = "Subsidy Source"
    DoCmd.OpenReport stDocName, acPreview
    Exit_Command148_Click:
    Exit Sub
    Err_Command148_Click:
    MsgBox Err.Description
    Resume Exit_Command148_Click

    End Sub

  9. #9
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    If I deleted all of the buttons and rebuilt them, do you think this would correct the problem? I did look under VB and I noticed two of the reports had: "Private Sub HOME_Units_Click()" as there first line.

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    IDE = integrated development environment
    Where you can type the VBA code.

    Multiple form/reports can use one subroutine, but there can be only one subroutine named "HOME_Units_Click" (Private Sub HOME_Units_Click())

    Did you search the VBA code for "HOME_Units_Click"? Keep track of where the code is located - what form or module..

  11. #11
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    ssanfu,

    "Did you search the VBA code for "HOME_Units_Click"? Keep track of where the code is located - what form or module.. "

    Yes, I did! See my response above.

  12. #12
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, sorry. Just checking

    Then the only thing I can suggest now is to delete the data (in a copy), do a compact and repair, zip it and post it. I won't be able to look at it until tonight, but maybe Allan (RG) or some one else could look at it sooner.

  13. #13
    genest11 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    19
    ssanfu,

    That was it! The double "HOME_Units_Click" in the VB. I deleted the duplicate and all is well. Thank you for your help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form stopped working in new year?
    By daniejm in forum Forms
    Replies: 14
    Last Post: 01-04-2013, 01:41 PM
  2. Access has stopped working
    By mrkaye in forum Access
    Replies: 0
    Last Post: 05-22-2012, 04:09 PM
  3. Access has stopped working
    By phillb in forum Forms
    Replies: 9
    Last Post: 01-10-2012, 12:22 PM
  4. Command Buttons on form
    By bespra in forum Forms
    Replies: 10
    Last Post: 11-12-2011, 01:50 PM
  5. All Buttons Stopped Working and...
    By rhoridge in forum Programming
    Replies: 1
    Last Post: 12-02-2010, 11:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums