VSFlexGrid二级联动下拉框的问题,求助
我在VSFlexGrid1里做了两个下拉联动的选择框,现在的问题是前面的第一列没有记录的时候第二列也会出现第一个单元格联动的数据,这个代码该怎么修改呀,我只想第一列不为空第二列才显示和第一列相对应的记录,下面是代码
Private Sub Form_Load()
Dim i As Integer
Me.VSFlexGrid1.Cols = 11 'áD
Me.VSFlexGrid1.Rows = 10 'DD
Me.VSFlexGrid1.FixedCols = 1
Me.VSFlexGrid1.FixedRows = 1
For i = 0 To Me.VSFlexGrid1.Rows - 1
Me.VSFlexGrid1.RowHeight(i) = 350
Next
'Me.VSFlexGrid1.ColComboList(0) = "..."
'Me.VSFlexGrid1.CellButtonPicture = Me.ImageList1.ListImages(1).Picture
Me.VSFlexGrid1.ColWidth(0) = 600
Me.VSFlexGrid1.ColWidth(1) = 2500
Me.VSFlexGrid1.ColWidth(2) = 2500
Me.VSFlexGrid1.ColWidth(3) = 800
Me.VSFlexGrid1.ColWidth(4) = 1000
Me.VSFlexGrid1.ColWidth(5) = 800
Me.VSFlexGrid1.ColWidth(6) = 1000
Me.VSFlexGrid1.ColWidth(7) = 1000
Me.VSFlexGrid1.ColWidth(8) = 1000
Me.VSFlexGrid1.ColWidth(9) = 1000
Me.VSFlexGrid1.ColWidth(10) = 1500
Me.VSFlexGrid1.TextMatrix(0, 0) = "DòoÅ"
Me.VSFlexGrid1.TextMatrix(0, 1) = "é豸Ãû3Æ"
Me.VSFlexGrid1.TextMatrix(0, 2) = "é豸DíoÅ"
Me.VSFlexGrid1.TextMatrix(0, 3) = "μ¥λ"
Me.VSFlexGrid1.TextMatrix(0, 4) = "μ¥¼Û"
Me.VSFlexGrid1.TextMatrix(0, 5) = "êyá¿"
Me.VSFlexGrid1.TextMatrix(0, 6) = "μ¥¼ÛoϼÆ"
Me.VSFlexGrid1.TextMatrix(0, 7) = "°2×°·ÑóÃ"
Me.VSFlexGrid1.TextMatrix(0, 8) = "¿ØÖÆÆ÷"
Me.VSFlexGrid1.TextMatrix(0, 9) = "ÆäËû·ÑóÃ"
Me.VSFlexGrid1.TextMatrix(0, 10) = "oϼÆ"
Call OpenConn
Sql = "select DISTINCT é豸Ãû3Æ from ¸ñá|é豸Ãû3Ʊí"
Rs.Open Sql, Cn, 1, 1
Do While Not Rs.EOF
Me.VSFlexGrid1.ColComboList(1) = Me.VSFlexGrid1.BuildComboList(Rs, "é豸Ãû3Æ")
Rs.MoveNext
Loop
Call CloseConn
End Sub
Private Sub VSFlexGrid1_Click()
If Me.VSFlexGrid1.TextMatrix(RowSel, 1) = "" Then Exit Sub
Call OpenConn
Sql = "select DISTINCT é豸DíoÅ from ¸ñá|é豸Díoűí where é豸Ãû3Æ='" & Me.VSFlexGrid1.TextMatrix(Me.VSFlexGrid1.Row, 1) & "'"
Rs.Open Sql, Cn, 1, 1
Do While Not Rs.EOF
Me.VSFlexGrid1.ColComboList(2) = Me.VSFlexGrid1.BuildComboList(Rs, "é豸DíoÅ")
Rs.MoveNext
Loop
Call CloseConn
End Sub