以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  对象设置到实例  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=96300)

--  作者:huhu
--  发布时间:2017/2/17 14:11:00
--  对象设置到实例

图片点击可在新窗口打开查看此主题相关图片如下:对象.png
图片点击可在新窗口打开查看

KeyDownEdit有什么问题吗?
If e.keyCode = Keys.Enter AndAlso e.Table.Cols(e.Table.colSel).Name = "SN"   Then
    e.cancel = True
    Dim r As Row = e.Table.addnew
    e.Table.Select(r.Index, 0)
    e.Table.StartEditing
End If
BeforeAddDataRow
Dim r As Row = Tables("销售出库单列表").Current
If r("配货状态") = True Then
    e.cancel = True
End If

--  作者:有点色
--  发布时间:2017/2/17 14:13:00
--  

Dim r As Row = Tables("销售出库单列表").Current
If r Is Nothing Then
    msgbox("没有数据")
    e.Cancel = True
Else
    If r("配货状态") = True Then
        e.cancel = True
    End If
End If


--  作者:huhu
--  发布时间:2017/2/17 15:21:00
--  
Dim r As Row = Tables("销售出库单列表").Current
If r Is Nothing Then
    msgbox("没有数据")
    e.Cancel = True
Else
    If r("配货状态") = True Then
        e.cancel = True
    End If
End If

这改的是BeforeAddDataRow吧。不是报KeyDownEdit吗?还是怎么个情况,我没看懂。

--  作者:有点色
--  发布时间:2017/2/17 15:29:00
--  

If e.keyCode = Keys.Enter AndAlso e.Table.Cols(e.Table.colSel).Name = "SN"   Then
    e.cancel = True
    Dim r As Row = e.Table.addnew
    If r Is Nothing Then
        msgbox("新增失败")
    Else
        e.Table.Select(r.Index, 0)
        e.Table.StartEditing
    End If
End If