以文本方式查看主题

-  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=132180)

--  作者:cyrollin
--  发布时间:2019/3/15 17:27:00
--  更新另外一张表的某行数据的问题
If e.DataRow("已收款") <> Nothing AndAlso e.DataRow("收款日期") <> Nothing
e.DataRow.Locked = True
Dim bh As String = e.DataRow("编号")
Dim dr As DataRow = DataTables("客户数据").SQLfind("编号 = \'"& bh &"\'and 日期 = #" & e.DataRow("服务日期") & "#")
If dr IsNot Nothing Then

With DataTables("表B")
dr("付款状态") = "已付"
End With    ‘找到表B的某行数据后,赋值给 “付款状态”列,但没有实现。。。

End If
End If

--  作者:有点甜
--  发布时间:2019/3/15 17:37:00
--  

试试

 

If e.DataRow("已收款") <> Nothing AndAlso e.DataRow("收款日期") <> Nothing
    e.DataRow.Locked = True
    Dim bh As String = e.DataRow("编号")
    Dim dr As DataRow = DataTables("客户数据").find("编号 = \'"& bh &"\'and 日期 = #" & e.DataRow("服务日期") & "#")
    If dr IsNot Nothing Then
        msgbox(123)
        dr("付款状态") = "已付"
        dr.save
    End If
End If


--  作者:cyrollin
--  发布时间:2019/3/18 16:43:00
--  
可以了,但是我用SQLfind, 为什么不可以查询后台数据,进行赋值呢? 如果我用find,就必须是前台数据才能实现给 付款状态 栏赋值, 而后台数据不能赋值。但用SQLfind,也不能给后台数据赋值。哪里还有其他问题吗?
--  作者:cyrollin
--  发布时间:2019/3/18 17:02:00
--  
完全可以了, 用SQLfind也可以了。如果用SQLfind, 查询表达示就不能用单引号,对不?
--  作者:有点甜
--  发布时间:2019/3/18 18:20:00
--  
以下是引用cyrollin在2019/3/18 17:02:00的发言:
完全可以了, 用SQLfind也可以了。如果用SQLfind, 查询表达示就不能用单引号,对不?

 

贴出你最后所写的代码。