以文本方式查看主题

-  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=16338)

--  作者:dqlgood
--  发布时间:2012/2/10 11:07:00
--  [求助]
 

表A有4个网页链接,不同行链接数量不同,我想在窗体中的4个按钮分别链接,当前行相应链接为空时按钮不显示,窗口的ValueChanged事件如下,并且执行通过,但当按表A的某列排序时出现如图所示窗口(表A在窗口控件中绑定),如何解决?

If Tables("表A").current("百度") = Nothing Then

    e.Form.Controls("Button1").Visible = False

Else

    e.Form.Controls("Button1").Visible = True

End If

If Tables("表A").current("雅虎") = Nothing Then

    e.Form.Controls("Button2").Visible = False

Else

    e.Form.Controls("Button2").Visible = True

End If

If Tables("表A").current("新浪") = Nothing Then

    e.Form.Controls("Button3").Visible = False

Else

    e.Form.Controls("Button3").Visible = True

End If

 

If Tables("表A").current("腾讯") = Nothing Then

    e.Form.Controls("Button4").Visible = False

Else

    e.Form.Controls("Button4").Visible = True

End If


图片点击可在新窗口打开查看此主题相关图片如下:fox.png
图片点击可在新窗口打开查看
[此贴子已经被作者于2012-2-10 11:12:25编辑过]

--  作者:狐狸爸爸
--  发布时间:2012/2/10 11:13:00
--  

1、最前面加一行:

 

If  Tables("表A").current Is Nothing then

   Return

End if

 

2、类似这样的代码:

 

If Tables("表A").current("百度") = Nothing Then

 

应该改为:

 

If Tables("表A").current.IsNull("百度") Then

 

3、建议看看:

http://www.foxtable.com/help/topics/1516.htm