I've got to call the click event for an MsFlexGrid object.
Private Sub MSFlexGridboxcodelist_Click()
box_code = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 1))
box_type = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 7))
Me.Txtpack_weight.text = Trim(Me.MSFlexGridboxcodelist.TextMatrix(Me.MSFlexGridboxcodelist.RowSel, 5))
Dim x As Integer
For x = 0 To Me.Combobox_type.ListCount - 1
If Me.Combobox_type.List(x) = box_type Then
Me.Combobox_type.ListIndex = x
Exit For
End If
Next
End Sub
The problem is when I actually click on the flexgrid, this part works as it should:
Me.Combobox_type.ListIndex = x
But when I do this:
Me.MSFlexGridboxcodelist.row = i
Me.MSFlexGridboxcodelist.TopRow = i
Me.MSFlexGridboxcodelist.RowSel = i
For x = 0 To Me.MSFlexGridboxcodelist.cols - 1
Me.MSFlexGridboxcodelist.ColSel = x
Next x
Call MSFlexGridboxcodelist_Click
The needed item in the combobox is not selected. So I guess the is a difference between clicking on something and calling the click event, but I have no clue what. I know I could just set the text of the combobox to whatever I want, but users shouldn't be allowed do it, so I set it's style attribute to Dropdown list.
Could you guys give me tip?
Thanks in advance.