' ***********************************************************
' Form: frm_main
'
' Function : login screen
'
' Date last Modified : 4/12/2010
'
'
' ***********************************************************
Option Compare Database
Option Explicit
' ******************************************************
' close form
' ******************************************************
Private Sub close_form_Click()
On Error GoTo Err_close_form_Click
DoCmd.RunMacro "macro_exit"
Exit_close_form_Click:
Exit Sub
Err_close_form_Click:
MsgBox Err.Description
Resume Exit_close_form_Click
End Sub
' ***********************************************************
' User has entered user_id and Password
' ***********************************************************
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
' Validate User ID and Password and then display menu items
display_menu
Exit_cmdOK_Click:
Exit Sub
Err_cmdOK_Click:
MsgBox Err.Description
Resume Exit_cmdOK_Click
End Sub
' ******************************************************
' relink database
' the user can relink the database by click on the word Password
' on the main menu
' ******************************************************
Private Sub database_relink_Click()
On Error GoTo Err_database_relink_Click
DoCmd.OpenForm "frm_relink"
Exit_database_relink_Click:
Exit Sub
Err_database_relink_Click:
MsgBox Err.Description
Resume Exit_database_relink_Click
End Sub
Private Sub password_BeforeUpdate(Cancel As Integer)
End Sub
' ****************************************************************
' when the user id gets the focus, the user id and password are reset to blank
' ****************************************************************
Private Sub user_id_GotFocus()
On Error GoTo Err_user_id_GotFocus
'remove current user and password
Me!user_id = Null
Me!password = Null
Exit_user_id_GotFocus:
Exit Sub
Err_user_id_GotFocus:
MsgBox Err.Description
Resume Exit_user_id_GotFocus
End Sub