以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  C版请进:求代码,还是不行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=6156)

--  作者:wqc360
--  发布时间:2010/3/11 19:34:00
--  C版请进:求代码,还是不行
表DoubleClick事件代码如下:
If e.Table.name = "产品工艺录入_Table3" \'如果操作窗口控件
    If  Vars("用户组") = "管理员"  or Vars("用户组") = "车间主管"  or Vars("用户组") = "录入员"  or Vars("用户组") = "车床班长"  \'如果用户
        Dim r as Datarow = CurrentTable.Current.DataRow \'指定窗口控件行
        Tables("产品工艺").ApplyFilter = False \'主表取消筛选
        tables("产品工艺").Position = tables("产品工艺").FindRow(r) \'指定窗口行与主表同步
        Tables("产品工艺").AllowEdit = True \'主表取消锁定
        Tables("产品工艺").Current.Locked = False \'取消锁定行
        Forms("车床产品工艺修改").open() \'打开窗口
        Return \'否则不执行
    End If
End If
现在我想加一条件:

If e.DataCol.Name = "审核" Then

    If e.NewValue = False Then   

       以上代码 

    End If

End If

但是不成功,不知应该怎么写,谢谢
[此贴子已经被作者于2010-3-12 10:52:01编辑过]

--  作者:czy
--  发布时间:2010/3/11 20:25:00
--  
If e.Col.Name = "审核" Then
    If e.Row("审核") = False Then
        \'……
    End If
End If

--  作者:wqc360
--  发布时间:2010/3/11 21:18:00
--  
搞定,谢谢C版
--  作者:wqc360
--  发布时间:2010/3/12 10:51:00
--  
C版,请帮我看一下,怎么一下两种都不行,如去掉审核判断正常。

If e.Table.name = "产品工艺录入_Table3" \'如果操作窗口控件
    If  Vars("用户组") = "管理员"  or Vars("用户组") = "车间主管"  or Vars("用户组") = "录入员"  or Vars("用户组") = "车床班长"  \'如果用户
        Dim r as Datarow = CurrentTable.Current.DataRow \'指定窗口控件行
        Tables("产品工艺").ApplyFilter = False \'主表取消筛选
        tables("产品工艺").Position = tables("产品工艺").FindRow(r) \'指定窗口行与主表同步
        If e.Col.Name = "审核" Then
            If e.Row("审核") = False Then
                Tables("产品工艺").AllowEdit = True \'主表取消锁定
                Tables("产品工艺").Current.Locked = False \'取消锁定行
                Forms("车床产品工艺修改").open() \'打开窗口
                Return \'否则不执行
            End If
        End If
    End If
End If



If e.Col.Name = "审核" Then
    If e.Row("审核") = False Then
        If e.Table.name = "产品工艺录入_Table3" \'如果操作窗口控件
            If  Vars("用户组") = "管理员"  or Vars("用户组") = "车间主管"  or Vars("用户组") = "录入员"  or Vars("用户组") = "车床班长"  \'如果用户
                Dim r as Datarow = CurrentTable.Current.DataRow \'指定窗口控件行
                Tables("产品工艺").ApplyFilter = False \'主表取消筛选
                tables("产品工艺").Position = tables("产品工艺").FindRow(r) \'指定窗口行与主表同步
                Tables("产品工艺").AllowEdit = True \'主表取消锁定
                Tables("产品工艺").Current.Locked = False \'取消锁定行
                Forms("车床产品工艺修改").open() \'打开窗口
                Return \'否则不执行
            End If
        End If
    End If
End If

--  作者:mr725
--  发布时间:2010/3/12 11:23:00
--  
不知道什么东东“不行”? 过程和结果要讲述清楚才好,下面只是猜测:

Dim r as Datarow = CurrentTable.Current.DataRow \'指定窗口控件行  用具体的Tables("xxxx")吧
        Tables("产品工艺").ApplyFilter = False \'主表取消筛选
        tables("产品工艺").Position = tables("产品工艺").FindRow(r) \'指定窗口行与主表同步
        If e.Col.Name = "审核" Then
            If e.Row("审核") = False Then
                Tables("产品工艺").AllowEdit = True \'主表取消锁定
                Tables("产品工艺").Current.Locked = False \'取消锁定行
                Forms("车床产品工艺修改").open() \'打开窗口
            else
                Return \'否则不执行
            End If
        End If

--  作者:wqc360
--  发布时间:2010/3/12 11:40:00
--  
有一窗口表,表为附表,双击附表中的行,打开另一窗口(解锁主表和本行),对本行数据可进行修改。
现在加上对审核的判断,就不能打开另一窗口了
--  作者:czy
--  发布时间:2010/3/12 11:54:00
--  
经测试下面的代码没有问题,这样看来是你全局变量赋值问题了。

If e.Col.Name = "审核" Then
    If e.Row("审核") = False Then
        If e.Table.name = "产品工艺录入_Table3" \'如果操作窗口控件
            Dim r as Datarow = CurrentTable.Current.DataRow \'指定窗口控件行
            Tables("产品工艺").ApplyFilter = False \'主表取消筛选
            tables("产品工艺").Position = tables("产品工艺").FindRow(r) \'指定窗口行与主表同步
            Tables("产品工艺").AllowEdit = True \'主表取消锁定
            Tables("产品工艺").Current.Locked = False \'取消锁定行
            Forms("车床产品工艺修改").open() \'打开窗口
        End If
    End If
End If

--  作者:wqc360
--  发布时间:2010/3/12 12:03:00
--  
还是不行,全局变量我很多地方有用到,其他地方都没为题,而且以上代码在没加审核判断以前也是正常的
--  作者:czy
--  发布时间:2010/3/12 12:05:00
--  
检查登录的用户名。
--  作者:czy
--  发布时间:2010/3/12 12:08:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.table