AnsweredAssumed Answered

Combobox populates another combobox in PI Processbook.

Question asked by Matthew1984 on Oct 13, 2015
Latest reply on Oct 13, 2015 by Matthew1984

Hello,

 

I am trying to write a If Statement so that when you select a option in a combobox that it automatically populates selection choices in another  combobox. My if statement works however it only lets you select the two options in the first combobox once and then stops working. Any ideas? Thanks! Here is my VBA code. So it works when you select facility and well the first time. But if you select facility again after selecting well then it doesn't work.

 

ThisDisplay.ComboBox1.Clear

ThisDisplay.ComboBox1.AddItem ("Facility")

ThisDisplay.ComboBox1.AddItem ("Well")

 

Private Sub ComboBox1_DropButtonClick()

If ThisDisplay.ComboBox1.Text = "Well" Then

ThisDisplay.ComboBox2.AddItem ("407101")

ThisDisplay.ComboBox2.AddItem ("408035")

ThisDisplay.ComboBox2.AddItem ("408045")

ThisDisplay.ComboBox2.AddItem ("416430")

ThisDisplay.ComboBox2.AddItem ("429052")

ThisDisplay.ComboBox2.AddItem ("429338")

ThisDisplay.ComboBox2.AddItem ("429422")

ThisDisplay.ComboBox2.AddItem ("429467")

ThisDisplay.ComboBox2.AddItem ("429808")

ThisDisplay.ComboBox2.AddItem ("429809")

ThisDisplay.ComboBox2.AddItem ("431719")

ThisDisplay.ComboBox2.AddItem ("442104")

ThisDisplay.ComboBox2.AddItem ("442110")

ThisDisplay.ComboBox2.AddItem ("442503")

ThisDisplay.ComboBox2.AddItem ("442508")

ThisDisplay.ComboBox2.AddItem ("442537")

ThisDisplay.ComboBox2.AddItem ("442547")

ThisDisplay.ComboBox2.AddItem ("442861")

ThisDisplay.ComboBox2.AddItem ("442986")

ThisDisplay.ComboBox2.AddItem ("442987")

ThisDisplay.ComboBox2.AddItem ("442995")

ThisDisplay.ComboBox2.AddItem ("443005")

ThisDisplay.ComboBox2.AddItem ("443006")

Else: ThisDisplay.ComboBox2.AddItem ("44287")

ThisDisplay.ComboBox2.AddItem ("44289")

ThisDisplay.ComboBox2.AddItem ("44290")

ThisDisplay.ComboBox2.AddItem ("44291")

ThisDisplay.ComboBox2.AddItem ("44292")

ThisDisplay.ComboBox2.AddItem ("44293")

ThisDisplay.ComboBox2.AddItem ("44294")

ThisDisplay.ComboBox2.AddItem ("44295")

ThisDisplay.ComboBox2.AddItem ("44298")

ThisDisplay.ComboBox2.AddItem ("47796")

End If

End Sub

Outcomes