以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  条件打开窗口  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=57502)

--  作者:Lc
--  发布时间:2014/9/25 16:54:00
--  条件打开窗口

Dim Filter As String
With e.Form.Controls("姓名")
    If .Value IsNot Nothing Then
        Filter = "姓名 = \'" & .Value & "\'"
    End If
End With
If Filter  > "" Then
    Tables("表A").Filter = Filter

End If

 

If Tables("表A").current("姓名") = " & e.Form.Controls("姓名").text & " Then
    Forms("窗口1").Open
End If

请指点代码错在哪?谢谢!

[此贴子已经被作者于2014-9-25 16:54:54编辑过]

--  作者:有点甜
--  发布时间:2014/9/25 16:56:00
--  

你想实现什么?

 

If Tables("表A").Rows.Count > 0 Then
    Forms("窗口1").Open
End If


--  作者:Lc
--  发布时间:2014/9/25 17:05:00
--  

If Tables("表A").current("姓名") = " & e.Form.Controls("姓名").text & " Then
    Forms("窗口1").Open
End If

 

表A 姓名 列= 窗口2 TextBox"姓名"时,打开 "窗口1",比如:表A姓名列是 "张山",TextBox1也是"张山",那么就打开"窗口1"

[此贴子已经被作者于2014-9-25 17:07:57编辑过]

--  作者:有点甜
--  发布时间:2014/9/25 17:07:00
--  
If Tables("表A").Current IsNot Nothing AndAlso Tables("表A").current("姓名") = Forms("窗口2").Controls("姓名").text Then
    Forms("窗口1").Open
End If

--  作者:Lc
--  发布时间:2014/9/25 17:16:00
--  

谢谢!