求助:从登陆窗口连接到主窗口的代码问题
各位老师,新人求助,我的登陆窗口与数据库连接都正常但从登陆窗口连接到主窗口的代码该怎样写入,特求各位老师详细指点,先谢了~!!
附后半段代码
Private Sub Form_Load()
Me.Left = Screen.Width / 2 - Me.Width / 2
Me.Top = Screen.Height / 2 - Me.Height / 2
Me.Caption = "登陆"
intTryTimes = 0
Set dbLogin = OpenDatabase(App.Path + "\Data.mdb", False, False, "MS Access;pwd=111")
' Set rstLogin = dbLogin.OpenRecordset("select Username from User")
' If rstLogin.RecordCount <> 0 Then
' Me.txtUser = rstLogin.Fields("Username")
' End If
Show
Me.txtUser.SetFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set rstLogin = Nothing
dbLogin.Close
End Sub
Private Sub txtPwd_GotFocus()
Me.txtPwd.SelStart = 0
Me.txtPwd.SelLength = Len(Me.txtPwd)
End Sub
Private Sub txtPwd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdLoginEnter_Click
End If
End Sub
Private Sub txtUser_GotFocus()
Me.txtUser.SelStart = 0
Me.txtUser.SelLength = Len(Me.txtUser)
End Sub
Private Sub txtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdLoginEnter_Click
End If
End Sub