Results 1 to 3 of 3

Thread: Label Name

  1. #1
    Join Date
    Apr 2002

    Unanswered: Label Name

    I have many labels in my form. What I wanna do is when I click on the label, a msgbox displaying its name will come up. I used to use screen.activecontrol (see below for code) when I want to display a textbox name, but it seems it does not work for label. Does anyone know how to achieve this ?

    Dim CurrentControl as control

    Set CurrentControl = Screen.ActiveControl


  2. #2
    Join Date
    Dec 2001
    A label control has no event procedures, nor can it ever receive the focus, so it will never be an "active control".

    You may want to re-think what you are trying to acheive.

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers

  3. #3
    Join Date
    Apr 2002

    I think label has several event procedures such Onclick and OnDoubleClick. The thing is I have more than 100 labels, so if someone clicks on it and wanna change the caption, it's much easier for me to create a general function that captures which label the user clicks rather than create a specific procedure for each label OnClick event. Do you have any idea how to get around this problem ?

Posting Permissions

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