Hello,
I am making a user form and I'd like it to contain: a drop down list, and 4 labels + 4 text boxes.
The idea is after a choice is made in drop down list, 4 label values are changed depending on array position, and 4 text boxes can update the values of the array.
So i fill up my array and then
Call DisplayFormEditLoc(allData())
After filling up my combobox i display it. Then i was hoping to call a sub in my main module that has the array as a public:
In ChoiceComboBoxChange sub id just update the values of all labels and since the change event triggers at start, it would also load the initial values.
But when i call ChoiceComboBoxChange it has none of the public variables.
I could of course do all the changes in the sub ChoiceComboBox_Change, but i can't figure out how to get the array values to it either.
How can this be done?
I am making a user form and I'd like it to contain: a drop down list, and 4 labels + 4 text boxes.
The idea is after a choice is made in drop down list, 4 label values are changed depending on array position, and 4 text boxes can update the values of the array.
So i fill up my array and then
Call DisplayFormEditLoc(allData())
Code:
Sub DisplayFormEditLoc(allData() As Variant)
Dim myInitFrm As DisplayFormEditLocs
Dim strCaption As String, i As Long, posSize As Long, posWeight As Long
Set myInitFrm = New DisplayFormEditLocs
posSize = 1
posWeight = 1
With myInitFrm
.Caption = "Editing measurements"
.CommandButtonConfirmation.Caption = "Edit"
.CommandButtonCancellation.Caption = "Cancel"
For i = 1 To UBound(allData(), 1)
If allData(i, 2) <> Empty Then .ChoiceComboBox.AddItem allData(i, 2)
Next i
.ChoiceComboBox.ListIndex = 0
.Show
End With
End Sub
Code:
Sub ChoiceComboBox_Change()
Dim indexer As Integer
indexer = ChoiceComboBox.ListIndex
Call ChoiceComboBoxChange(indexer)
End Sub
But when i call ChoiceComboBoxChange it has none of the public variables.
I could of course do all the changes in the sub ChoiceComboBox_Change, but i can't figure out how to get the array values to it either.
How can this be done?