我找到个传递变量的,也把代码分享给大家一下吧
Public Function QuanXian(blnDJ As Boolean)
If blnDJ = True Then
MDIForm1.mnuAddNew = True
MDIForm1.mnuIn = True
MDIForm1.mnuOut = True
Else
MDIForm1.mnuAddNew = False
MDIForm1.mnuIn = False
MDIForm1.mnuOut = False
End If
End Function
rs2.Open "Select 权限 From 系统 Where 用户名='" & Combo1.Text & "' ", _
cn, adOpenKeyset, adLockOptimistic
If rs2.Fields(0) = "System" Then blnDJ = True
If rs2.Fields(0) = "Guest" Then blnDJ = False
Private Sub MDIForm_Load()
Call QuanXian(blnDJ)
End Sub
Public Function QuanXian(blnDJ As Boolean)
If blnDJ = True Then
MDIForm1.mnuAddNew = True
MDIForm1.mnuIn = True
MDIForm1.mnuOut = True
Else
MDIForm1.mnuAddNew = False
MDIForm1.mnuIn = False
MDIForm1.mnuOut = False
End If
End Function
rs2.Open "Select 权限 From 系统 Where 用户名='" & Combo1.Text & "' ", _
cn, adOpenKeyset, adLockOptimistic
If rs2.Fields(0) = "System" Then blnDJ = True
If rs2.Fields(0) = "Guest" Then blnDJ = False
Private Sub MDIForm_Load()
Call QuanXian(blnDJ)
End Sub