避免重复插入值到msflexgrid表
我在做进销存时,在销售部分当我选取某类产品销售并输数量时,我想如何避免下次又重复选取原来的产品,Set IDlist = New Collection
If Grid1.TextMatrix(Grid1.RowSel, 0) <> "" Then
Adodc2.RecordSource = "select * from tbS_in_detailed where 序号=" & Grid1.TextMatrix(Grid1.RowSel, 0)
Adodc2.Refresh
If Adodc2.Recordset.EOF Then GoTo Move2:
For I = 1 To IDlist.Count
If Adodc2.Recordset.Fields(0).Value = IDlist(I) Then Exit Sub
Next
Frmssd.Grid.Rows = Frmssd.Grid.Rows + 1
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 0) = Adodc2.Recordset.Fields(0)
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 1) = Adodc2.Recordset.Fields("入库单号")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 2) = Adodc2.Recordset.Fields("产品编号")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 3) = Adodc2.Recordset.Fields("面密度")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 4) = Adodc2.Recordset.Fields("宽度")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 5) = Adodc2.Recordset.Fields("厚度")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 6) = Adodc2.Recordset.Fields("长度")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 7) = Adodc2.Recordset.Fields("面积")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 8) = Adodc2.Recordset.Fields("剪切员")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 9) = Format(0, "0.00")
Frmssd.Grid.TextMatrix(Frmssd.Grid.Rows - 1, 10) = Format(0, "0.00")
IDlist.Add Adodc2.Recordset.Fields(0).Value
错在哪呀
补充:VB , 数据库(包含打印,安装,报表)