以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  为啥无法引用全局变量  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=125349)

--  作者:susu312
--  发布时间:2018/9/26 19:40:00
--  为啥无法引用全局变量

\'\'定义临时变量
Dim dr As DataRow
\'\'设置控件不可用
e.Form.Controls("userOrgan").Enabled = False
e.Form.Controls("userRole").Enabled = False
e.Form.Controls("userName").Enabled = False
\'\'设置窗口标题值
e.Form.Text = e.Form.Text & "-" & _UserName
\'\'从数据库提取
dr = DataTables("user").SQLFind(" userName = \'" & _UserName & "\' and  organName = \'"& _UserOrgan &"\' and userRole = \'"& _UserRole &"\'")
If dr IsNot Nothing Then
    e.Form.Controls("userOrgan").Value= dr("organName")
    e.Form.Controls("userRole").Value=dr("userRole")
    e.Form.Controls("userName").Value=dr("userName")
    e.Form.Controls("userPassword").Value=dr("userPassword")
Else
    MessageBox.Show("用户不存在或者已经被删除!","提示",MessageBoxButtons.OK)
    e.Form.Close()
End If

 

那个是全局变量, 但是无法引用为啥呀


--  作者:有点甜
--  发布时间:2018/9/26 19:49:00
--  

1、你说的无法引用,指什么?报错?还是没有值?

 

2、msgbox(_userName)弹出什么?