|
以下是我登陆界面的代码
Private Sub Command12_Click()
Dim stdocname As String
Dim stlinkcriteria As String
'Dim user_name_login As String
Set rsX = CurrentDb.OpenRecordset("select * from [login] where [user_id]='" & Text8 & "' and [user_password]='" & Text10 & "'")
If Not rsX.EOF Then
user_id = Me.Text8.Value '保存用户工号
user_name_login = rsX.user_name '保存用户名
user_password = Me.Text10.Value '保存密码
rsX.Close
DoCmd.Close
stdocname = "考核管理信息系统主界面"
DoCmd.OpenForm stdocname, , , stlinkcriteria
Else
MsgBox "用户名或密码错误,请重新登陆!", vbOKOnly, "系统提示"
Text8 = Null
Text10 = Null
rsX.Close
Text8.SetFocus
End If
End Sub
以下是在模块中的变更声明
Global user_id As String
Global user_name As String
Global user_password As String
以下是我在登陆进去后主窗体的FORM_load代码
Private Sub Form_Load()
DoCmd.Maximize
Me!Label51.Caption = Str(Year(Date)) + "年" + Str(Month(Date)) + "月" + Str(Day(Date)) + "日"
Me!Label49.Caption = user_name_login
End Sub
现在我想在主窗体的label49上显示登陆界面的用户名信息。 |
|