Results 1 to 4 of 4
  1. #1
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38

    Time limit to form

    Hai guys,
    I one DB
    In that I want to add time limit to forms
    Means when form open it's could down will start then time limit 30 mins if it is reached forms automatically closed and if I open the form with as another entry then time start from zero then when it will reach 30 mins form will automatically closed


    Please I want this code
    Anyone please provide this code

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Check out the form's timer event. Set a variable to the current time in the load event and the compare that variable to the current time, and close the form when it exceeds 30 minutes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TskcAccessdev is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2017
    Posts
    38
    Thanks for reply
    But I'm very sorry to say that I don't know how to write
    And how to set
    If possible could you provide the code or link
    If possible only

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Google: Access vba timer event

    https://msdn.microsoft.com/en-us/vba...or=-2147217396
    http://www.blueclaw-db.com/access_ev...ming/timer.htm

    Set the form's timer interval property to 1,800,000 - that is milliseconds = 30 minutes.

    Then select [Event Procedure] in the OnTimer event. Click the ellipsis (...) to open VBA editor. Code in the event:

    Private Sub Form_Timer()
    DoCmd.Close
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 04-14-2014, 01:38 PM
  2. Replies: 2
    Last Post: 08-02-2012, 01:47 PM
  3. How to Limit the Value of Form input by
    By hwong in forum Forms
    Replies: 6
    Last Post: 07-20-2012, 07:00 PM
  4. Replies: 0
    Last Post: 02-28-2011, 10:26 PM
  5. Replies: 1
    Last Post: 10-22-2010, 01:29 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