Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Angry Unanswered: Get the name of the clicked button


    I got a lot of commandbuttons on my form (40).
    All of these 40 buttons have another name but they have all the same actioncode.

    Can I request in the code what the name is of the clicked button?
    (in visual basic .NET you can use but access is still an older version )

    Thanx in advance

  2. #2
    Join Date
    Mar 2004

    Re: Get the name of the clicked button

    Are your 40 buttons in a control array (each button has the same name but a different index number)? If so then in the click event this will work:

    Private Sub Button_Click(Index As Integer)

    MsgBox Button(Index).Name

    End Sub

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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