以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]纠正代码错误  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=127638)

--  作者:老鼠
--  发布时间:2018/11/18 22:30:00
--  [求助]纠正代码错误
Dim ndz As String = e.Form.Controls("ComboBox1")
Dim sdz As String = e.Form.Controls("ComboBox2")
Dim str As String = DataTables("认证人员").GetComboListString("居民身份号码","[认证年度] = \'ndz\' And [归属时期] = \'sdz\'")
str = str.Replace("|","\',\'")
Tables("生存人员").Filter = "居民身份号码 not in(\'" & str & "\')"
Dim book As new xls.book(ProjectPath & "attachments\\未认证表.xls")
book.Build()
book.save(ProjectPath & "reports\\未认证表.xls")
Dim proc As new Process
proc.file = ProjectPath & "reports\\未认证表.xls"
proc.Start()

--  作者:老鼠
--  发布时间:2018/11/18 22:50:00
--  
我自己改成了这个样子,改后代码为有效:
Dim ndz As String = e.Form.Controls("ComboBox1").Value
Dim sdz As String = e.Form.Controls("ComboBox2").Value
Dim str As String = DataTables("认证人员").GetComboListString("居民身份号码","[认证年度] = \'" & ndz & "\' And [归属时期] = \'" & sdz & "\'")
str = str.Replace("|","\',\'")
Tables("生存人员").Filter = "居民身份号码 not in(\'" & str & "\')"
Dim book As new xls.book(ProjectPath & "attachments\\未认证表.xls")
book.Build()
book.save(ProjectPath & "reports\\未认证表.xls")
Dim proc As new Process
proc.file = ProjectPath & "reports\\未认证表.xls"
proc.Start()

Tables("生存人员").Filter = ""

请问各位老师,还有什么简单的代码吗?

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

--  作者:有点甜
--  发布时间:2018/11/19 0:23:00
--  
代码必须这样写