急请大家帮忙关于vb
在grid表里如果上一行没有填写数据鼠标不能指向下一行我的代码是请大家帮我看看那有毛病?Dim strValue As String, lngCol As Long, lngRow As Long, i As Integer
lngCol = Col '记录列号“
lngRow = Row '记录行号
If Row = 1 Then
sRow = Row
sCol = Col
Exit Sub
End If
'================================
' 判断上一行是否有值
'================================
SGrid.Row = Row - 1
For i = 1 To 6
SGrid.Col = i
strValue = strValue & Trim(SGrid.Text)
Next i
'===============================
' 若无值,则焦点返回原来网格
'===============================
If strValue = "" Then
SGrid.Col = sCol
SGrid.Row = sRow
Exit Sub
End If
sRow = Row
sCol = Col
MsgBox "LeaveRow"
End Sub