Results 1 to 6 of 6
  1. #1
    zozo.zead is offline Novice
    Windows 11 Access 2016
    Join Date
    Oct 2023
    Posts
    14

    Return to the user interface (login)

    Idea: - When you leave the program running and do not move the mouse
    After a certain period, let it be two minutes, the open form will be closed and it will return to the user interface (login).

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,511
    in the form set the ON TIMER INTERVAL property to 60000 (60 seconds,aka 1 min, aka 60000 millisecs)
    then the mouse & keystrokes will reset the counter
    in ON CLOSE event, it should just show the menu behind it, or you can call the f.LOGIN

    Code:
    'form (module) level counter
    private  mlMins as long
    
    Private Sub Form_Timer()
    mlMins = mlMins + 1
    If mlMins = 2 Then DoCmd.Close
    End Sub
    
    
    Public Sub ResetTimer()
    Me.TimerInterval = 0
    Me.TimerInterval = 60000
    mlMins = 0
    End Sub
    
    
    Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ResetTimer
    End Sub
    
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    ResetTimer
    End Sub

  3. #3
    zozo.zead is offline Novice
    Windows 11 Access 2016
    Join Date
    Oct 2023
    Posts
    14
    I will try it and get back the results

  4. #4
    zozo.zead is offline Novice
    Windows 11 Access 2016
    Join Date
    Oct 2023
    Posts
    14
    My Test

    I need when the "Form1" Closed "Form2" Open
    Attached Files Attached Files

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,511
    in FORM_CLOSE event , open yr other form:

    Code:
    Private Sub Form_Close()
    DoCmd.OpenForm "form2"
    End Sub

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,651
    Or just don't close the form you want to return to in the first place. DoCmd.Close will close the active form and that changes as opened forms close. Best to refer to the object by name if you can. I'd do something like
    Code:
    Private Sub Form_Timer()
    Dim frm As Form
    
    mlMins = mlMins + 1
    If mlMins = 2 Then
        For Each frm In Forms
            If CurrentProject.AllForms(frm.Name).IsLoaded And frm.Name <> "form1" Then
                DoCmd.Close acForm, frm.Name
            End If
        Next
    'DoCmd.OpenForm "Form1", acNormal
    End If
    Change <> "form1" to the name of the form you'd want to leave open. If it happens that it's not open, it won't matter because it isn't loaded.
    
    End Sub
    EDIT - I gather that you don't use Option Explicit or Option Compare in any of your databases because neither is used in the one you posted.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. User Interface Design
    By bchankent in forum Access
    Replies: 5
    Last Post: 12-15-2015, 09:20 PM
  2. Replies: 5
    Last Post: 01-12-2015, 03:44 PM
  3. User Interface Missing - Help Please
    By historian in forum Access
    Replies: 20
    Last Post: 02-22-2013, 04:14 AM
  4. User Interface
    By scubagal in forum Access
    Replies: 3
    Last Post: 07-26-2011, 02:21 PM
  5. Replies: 0
    Last Post: 07-07-2010, 12:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums