Foxtable(狐表)用户栏目专家坐堂 → [求助]纠正代码错误


  共有1686人关注过本帖树形打印复制链接

主题:[求助]纠正代码错误

帅哥哟,离线,有人找我吗?
老鼠
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:360 积分:3606 威望:0 精华:0 注册:2008/11/2 21:50:00
[求助]纠正代码错误  发帖心情 Post By: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()

 回到顶部
帅哥哟,离线,有人找我吗?
老鼠
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:360 积分:3606 威望:0 精华:0 注册:2008/11/2 21:50:00
  发帖心情 Post By: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编辑过]

 回到顶部