Hi,
Good afternoon.
Thank you for your valuable suggestion.
Please refer to the below code for your kind perusal and do the need full.
/* Step 1: Fill grid combo with Active/Inactive rows.
sSQL = "SELECT InspectionCharacteristicID, Name FROM Setup.InspectionCharacteristic ORDER BY Name"
Set rsFillCombo = New ADODB.Recordset
If rsFillCombo.State = 1 Then rsFillCombo.Close
rsFillCombo.Open sSQL, m_ConnectDB, adOpenForwardOnly, adLockReadOnly
With iGridName(iGrd)
.BeginUpdate
Set cboGrid = .Combos.Add("InspectionCharacteristicID")
cboGrid.FillFromRS rsFillCombo, "Name", "InspectionCharacteristicID"
cboGrid.AutoAdjustWidth
.EndUpdate
End With
Set rsFillCombo = Nothing
*/
/* Step 2: Populate grid rows
strSQL = "SELECT StockInspectionID, InspectionCharacteristicID, EquipmentTypeID, DefectCategoryID, SamplingSizeID, SamplingTypeID, InspectionLevelID,MinSpecification,MaxSpecification,IsOnlineMonitor
FROM RD.StockItemInspection WHERE (StockitemID = 1)"
Set rsFill = New ADODB.Recordset
rsFill.Open strSQL, m_ConnectDB
With iGrid
.BeginUpdate
.FillFromRS rsFill, , "StockInspectionID"
.AddRow
.EndUpdate
End With
*/
/* Step 3: Refill combo with only Active rows
sSQL = "SELECT InspectionCharacteristicID, Name FROM Setup.InspectionCharacteristic WHERE (Active = 1) ORDER BY Name"
Set rsFillCombo = New ADODB.Recordset
If rsFillCombo.State = 1 Then rsFillCombo.Close
rsFillCombo.Open sSQL, m_ConnectDB, adOpenForwardOnly, adLockReadOnly
With iGridName(iGrd)
.BeginUpdate
Set cboGrid = .Combos.Add("InspectionCharacteristicID")
cboGrid.FillFromRS rsFillCombo, "Name", "InspectionCharacteristicID"
cboGrid.AutoAdjustWidth
.EndUpdate
End With
Set rsFillCombo = Nothing