Private Sub Form_Load()

    On Error GoTo Err_Out

    Dim lTemp As Long
    Dim sTemp As String

    lTemp = SetTimer(Me.hwnd, NV_INPUTBOX, 1, AddressOf TimerProc)

    sTemp = inputbox("Please Enter your password", "Security Dialogue")

    If sTemp = vbNullString Then
        ' If the user clicked OK without entering anything
        ' Or if the user clicked cancel, generate a custom error
        Err.Raise 1000, "Password Entry", "A Password is required"
    Else
        MsgBox sTemp
    End If

    Exit Sub

Err_Out:

    Select Case Err.Number

    Case 1000
        MsgBox Err.Description, vbCritical + vbOKOnly, Err.Source
        Err.Clear
        Unload Me

    Case Else
        Err.Clear
        Unload Me

    End Select

End Sub