你要累加,就找出原来的行,如果存在就累加,不存在就增加:
Dim Tx As WinForm.DropDownBox = e.Sender
If Tx.Text.Length = 8 Then '设定条码位数
If Tables("DD").Rows.count = 0 Then
Tables("DD").Addnew
End If
Dim er As Row
For Each r As Row In Tables("DD.DDMX").Rows '判断是否存在这行
If r("DDMX_hh")= Tx.Text Then
er = r
Exit For
End If
Next
If er Is Nothing Then '不存在就增加
er = Tables("DD.DDMX").AddNew
er("DDMX_hh")= Tx.Text
End If
er("DDMX_sl") = er("DDMX_sl") + 1
er.save()
tx.text = ""
If Tables("DD.DDMX").Rows.Count > 0 Then
e.Form.Controls("DropBox1").Select()
End If
End If