Private Sub Grid_Stock_KeyPress(KeyAscii As Integer)
Dim I As Integer
Dim TmpStr As String
If Backing = False Then Exit Sub
If Backing = True And ((KeyAscii < 48 Or KeyAscii > 57) _
And KeyAscii <> 13) Then KeyAscii = 0
If KeyAscii = 13 Then
ScanID = Trim(ScanID)
If Len(ScanID) <> 16 Then
MsgBox "您输入的编码不符合要求!"
ScanID = ""
Exit Sub
End If
If AddCard Is Nothing Then
MsgBox "数据连接不存在!"
ScanID = ""
Exit Sub
End If
If AddCard.GetNumber(ScanID) = False Then
MsgBox "你输入的编码无效"
ScanID = ""
Exit Sub
End If
Grid_Stock.Rows = Grid_Stock.Rows + 1
Grid_Stock.TextMatrix(Grid_Stock.Rows - 2, 0) = CStr(Grid_Stock.Rows - 2)
Grid_Stock.TextMatrix(Grid_Stock.Rows - 2, 1) = ScanID
ScanID = ""
Else
If KeyAscii <> 0 Then ScanID = ScanID & Chr(KeyAscii)
lbl.Caption = ScanID & " " & CStr(Len(ScanID)) '''发布时需要屏蔽
End If
End Sub