Here is the youtube link for the problem(demo)
Here is the exact code I use to populate the grid combobox
Private Sub DoCombos()
Dim strInvFilter As String
On Error GoTo Sub_EH: mstrStackTrace = mstrStackTrace & "." & "DoCombos"
'Create Dynamic combos for each row in the Pick Grid - Load combo with available Units
igrid1.Combos.Clear
For mlx = 1 To igrid1.Combos.Count
igrid1.Combos.Remove (mlx)
Next
For mlx = 1 To igrid1.RowCount
If "" <> GetRecord("Select TOP(1) 1 FROM tblInventory Where ICOMStype='" & igrid1.CellValue(mlx, "ICOMStype") & "' AND ICOMStype<>ICOMSNumber") Then
adorsInvNumber.Filter = "ICOMStype = '" & igrid1.CellValue(mlx, "ICOMStype") & "' AND Location =" & IIf(cjlAb <> "", "'" & cjlAb & "'", "'SLAB'") ''SLAB'"
With igrid1.Combos.add(igrid1.CellValue(mlx, "ICOMStype")) ' + CStr(igrid1.Combos.Count))
.AddItem " "
If adorsInvNumber.RecordCount > 0 Then
For y = 1 To adorsInvNumber.RecordCount
.AddItem adorsInvNumber!ICOMSNumber
adorsInvNumber.MoveNext
Next
End If
End With
DUPLICATE:
igrid1.CellType(mlx, "ICOMSNumber") = igCellCombo
igrid1.CellCtrlKey(mlx, "ICOMSNumber") = igrid1.CellText(mlx, "ICOMStype")
igrid1.ColDefaultCell("ICOMSNumber").eType = igCellCombo
igrid1.ColDefaultCell("ICOMSNumber").sCtrlKey = igrid1.CellValue(mlx, "ICOMStype")
End If
Next
Sub_Exit:
Exit Sub
Sub_EH:
If Err.Number = 457 Then
Resume DUPLICATE
End If
End Sub