Results 1 to 4 of 4
  1. #1
    shah1419 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    30

    automatically update after some time.

    i am using access database. my requirements is after every 5 minutes it should check the new entry in table and insert it into new table after every 5 minutes only the new entries.


    please advised.

    Table A
    Stuid Number
    Intime text
    Otime text
    Dated date

    Table B
    Stuid number
    msgto varchar2(30)
    msg varchar2(300)
    send varhar2(1)

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    The following is based on you having a good reason form duplicating data, such as copying from linked ODBC tables that you don't have edit rights on.

    You could create a form add a timer event and in the event code, execute any query required to do the updating. I presume this would be an update query. The form can be invisible, and be automatically loaded when the db opens, or if you already have that reserved for another form, that form can open the timer form and make it invisible. For the timer interval, 1000 is one second, so 5 minutes is 300 times that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    shah1419 is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    30
    Code:
    Private Sub USERID_AfterUpdate()On Error GoTo ErrorHandler
    DoCmd.SetWarnings False
     Dim StrSQl As String
        StrSQl = "Insert into MsgOut (id,msg,send,msgto) "
        StrSQl = StrSQl & "SELECT [STUDENT].[GR No], ' Inout Ho Gya Hay:::DAR-E-ARQAM SCHOOL. ', True , [STUDENT].[Mobile] "
        StrSQl = StrSQl & "FROM [STUDENT] " & _
                "WHERE [STUDENT].[STATUS]='Active' " & _
                "and userid=[gr no]"
                ' CurrentDb.Execute StrSQl, dbFailOnError
                 DoCmd.RunSQL (StrSQl)
    ExitHandler:
    DoCmd.SetWarnings True
    Exit Sub
    ErrorHandler:
    MsgBox Err.Number & Chr(13) & Err.Description
    Resume ExitHandler
    
    
    End Sub
    i am using this code in after update event. it working fine .
    but i want to it will check in every 5 minutes the new data between the 5 minutes automatically insert into new table-B.
    i have set the time interval=1000

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

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

Similar Threads

  1. Replies: 11
    Last Post: 03-27-2018, 11:38 AM
  2. Replies: 1
    Last Post: 05-21-2016, 08:51 AM
  3. Replies: 2
    Last Post: 09-23-2015, 09:02 PM
  4. Replies: 3
    Last Post: 04-09-2013, 01:39 PM
  5. Automatically enter today's date when entering time
    By Szabi in forum Database Design
    Replies: 5
    Last Post: 03-16-2012, 03:50 AM

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