AnsweredAssumed Answered

Executing a button using VBA

Question asked by Israa on Mar 20, 2019
Latest reply on Mar 20, 2019 by Eugene Lee

Hello Everyone,


I have created a List Box that contains 4 options from which the user can choose and each choice executes a button in the display (which is set invisible), as in Bold below:


Now the problem is when I run the code it shows me " This object doesn't support this property or method", so what is the right way to execute the buttons?


Private Sub ListBox1_Click()

ListBox1.AddItem "AL 11", 0
ListBox1.AddItem "AL 12", 1
ListBox1.AddItem "AL 13", 2
ListBox1.AddItem "AL 14", 3


    If ListBox1.Text = "AL 11" Then
        ThisDisplay.Button2.Value = True

    ElseIf ListBox1.Text = "AL 12" Then
        ThisDisplay.Button3.Value = True

    ElseIf ListBox1.Text = "AL 13" Then
       ThisDisplay.Button4.Value = True


    ElseIf ListBox1.Text = "AL 14" Then
        ThisDisplay.Button5.Value = True


    End If

End Sub