以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  追加新数据  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127777)

--  作者:manyifuwu
--  发布时间:2018/11/21 22:14:00
--  追加新数据

希望:用的sql数据源。A电脑增加行后,B电脑也能加载出来。

Dim Filter As String
Dim dtp1 As Date
dtp1 = e.Form. Controls("DateTimePicker1").Value
If e.Form. Controls("DateTimePicker1").Value Is Nothing
    Messagebox.show("请输入派工日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If

\'Dim Filter As String
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        Filter = Filter & "时间 like \'%" & .Value & "%\'"
    End If
End With
With e.Form.Controls("cmbProduct")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "部门 like \'%" & .Value & "%\'"
    End If
End With

With e.Form.Controls("ComboBox2")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "合同状态 Like \'%" & .Value & "%\'"
    End If
End With

With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "截止日期 >= \'" & .Value & "\'"
    End If
End With
With e.Form.Controls("DateTimePicker1")
    If .Value IsNot Nothing Then
        If Filter >"" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "截止日期 <= \'" & .Value & "\'"
    End If
End With

If Filter > "" Then
    DataTables("派工_Table1").LoadFilter = Filter
    DataTables("派工_Table1").Load()
End If

Dim id As Integer = DataTables("派工").Compute("Max(_Identify)")
Dim
Filter1 As String = "[_Identify] > " & id
DataTables
("派工").AppendLoad(Filter1, False
)
Tables("派工_Table1").Filter = Filter & " and (交单 is null or 交单 not like \'%取消%\')"
Tables("派工_Table1").Sort = "时间"

 

[此贴子已经被作者于2018/11/21 22:16:18编辑过]

--  作者:有点甜
--  发布时间:2018/11/21 22:15:00
--  

参考

 

http://www.foxtable.com/webhelp/scr/2276.htm

 

http://www.foxtable.com/webhelp/scr/2914.htm

 

 


--  作者:manyifuwu
--  发布时间:2018/11/21 22:15:00
--  
 

帮助里的这个

Dim id As Integer = DataTables("表A").Compute("Max(_Identify)")
Dim
Filter As String = "[_Identify] > " & id
DataTables
("表A").AppendLoad(Filter, False
)

 

每次都要很长时间。

有更高效的办法吗?


--  作者:有点甜
--  发布时间:2018/11/21 22:16:00
--  

如果要即时,需要用到openQQ了

 

http://www.foxtable.com/webhelp/scr/3006.htm