Foxtable(狐表)用户栏目专家坐堂 → 菜单代码


  共有2910人关注过本帖平板打印复制链接

主题:菜单代码

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


加好友 发短信
等级:四尾狐 帖子:929 积分:6500 威望:0 精华:0 注册:2014/6/25 10:48:00
菜单代码  发帖心情 Post By:2015/3/31 9:31:00 [只看该作者]

老师,下面是菜单里的“删除行”按钮的代码,结果是,它会删除所有表中“XZH”为TRUE的行,而我的要求是只要删除当前表所选择的行。

If user.NAME = "管理员" Then
  For Each r As Row In Tables("fkb2").Rows
    If r("XZH") = True Then
      Syscmd.Row.Delete()
    End If
   Next

ElseIf User.IsRole("总工办") Then
   For Each r As Row In Tables("XMJDB").Rows
   MainTable=Tables("XMJDB")
   If r("XZH") = True Then
    If Tables("xmjdb").current.Isnull("BMSH") = False Then
        MessageBox.Show("数据已经审核通过,你不能删除!.")
    Else
       Syscmd.Row.Delete()
    End If
   End If
   Next

END IF

 

然后改成下列代码后就提示错误,请老师指导,谢谢??

If user.NAME = "管理员" Then
  For Each r As Row In CurrentTable("fkb2").Rows
    If r("XZH") = True Then
      Syscmd.Row.Delete()
    End If
   Next

ElseIf User.IsRole("总工办") Then
   For Each r As Row In CurrentTable("XMJDB").Rows
   MainTable=Tables("XMJDB")
   If r("XZH") = True Then
    If Tables("xmjdb").current.Isnull("BMSH") = False Then
        MessageBox.Show("数据已经审核通过,你不能删除!.")
    Else
       Syscmd.Row.Delete()
    End If
   End If
   Next

END IF

是不是要将CurrentTable("XMJDB").Rows改成CurrentTable.Rows呢??


[此贴子已经被作者于2015/3/31 9:33:09编辑过]

 回到顶部